[FFmpeg-devel] [PATCH] tta : add output buffer size check

Jai Menon jmenon86
Sun Mar 28 14:45:15 CEST 2010


On Sun, Mar 28, 2010 at 5:40 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Mar 28, 2010 at 04:00:08PM +0530, Jai Menon wrote:
>> Hello,
>>
>> as in subject. should fix issue 1848.
>>
>> --
>> Jai Menon
>
>> ?tta.c | ? ?4 ++++
>> ?1 file changed, 4 insertions(+)
>> 8b7094c9fccf093b8e4bd59fba68703efffc380a ?tta_buffer_bounds_check.patch
>> Index: libavcodec/tta.c
>> ===================================================================
>> --- libavcodec/tta.c ?(revision 22706)
>> +++ libavcodec/tta.c ?(working copy)
>> @@ -302,6 +302,10 @@
>> ? ? ? ? ?int cur_chan = 0, framelen = s->frame_length;
>> ? ? ? ? ?int32_t *p;
>>
>> + ? ? ? ?if (*data_size < (framelen * s->channels * 2)) {
>> + ? ? ? ? ? ?av_log(avctx, AV_LOG_ERROR,"Output buffer size is too small.\n");
>> + ? ? ? ? ? ?return -1;
>> + ? ? ? ?}
>
> framelen can be changed a few lines later

yeah, but last_frame_length is necessarily < frame_length so the check
is good imho.

> also testing with tools/trasher probably doesnt hurt

will do that in a bit, but i think the check is still useful.

-- 
Jai Menon



More information about the ffmpeg-devel mailing list