[Ffmpeg-devel] [patch] additional malloc padding in libavformat
Michael Niedermayer
michaelni
Sat Dec 17 18:44:34 CET 2005
Hi
On Sat, Dec 17, 2005 at 06:20:17PM +0100, Jindrich Makovicka wrote:
> Hi,
>
> this patch adds the malloc padding to several libavformat demuxers to
> avoid reading past the malloc()ed area.
>
> Credits to Mikulas Patocka (mikulas at artax karlin mff cuni cz)
>
> Ok to apply?
yes but see below
[...]
> - st->codec->extradata= av_malloc(st->codec->extradata_size);
> + st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
> + memset(st->codec->extradata+st->codec->extradata_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
av_mallocz() seems to be a simpler choice here ...
[...]
> - st->codec->extradata = av_malloc(VMD_HEADER_SIZE);
> + st->codec->extradata = av_malloc(VMD_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
> + memset(st->codec->extradata+VMD_HEADER_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
and here
[...]
> - st->codec->extradata = av_malloc(VQA_HEADER_SIZE);
> + st->codec->extradata = av_malloc(VQA_HEADER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
> + memset(st->codec->extradata+VQA_HEADER_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
and here too
[...]
--
Michael
More information about the ffmpeg-devel
mailing list