[FFmpeg-devel] [PATCH 10/12] shorten: remove VLA and check for buffer overflow

Måns Rullgård mans
Thu Jun 24 15:14:53 CEST 2010


Benoit Fouet <benoit.fouet at free.fr> writes:

>> +    coeffs = av_realloc(s->coeffs, s->nwrap * sizeof(*s->coeffs));
>> +    if (!coeffs)
>> +        return -1;
>
> an ENOMEM would look better.

Agree, although the error code is lost later on.  I don't intend to
clean up all of it just now.

>> @@ -515,6 +530,7 @@ static av_cold int shorten_decode_close(AVCodecContext *avctx)
>>          av_freep(&s->offset[i]);
>>      }
>>      av_freep(&s->bitstream);
>> +    av_freep(&s->bitstream);
>
> s/bitstream/coeffs/

Of course.

OK to commit with these fixes?

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list