From: Alexander Strange Date: Fri, 19 Dec 2008 01:00:44 +0000 (+0000) Subject: Allocate and clear FF_INPUT_BUFFER_PADDING_SIZE bytes at the end of mkv X-Git-Tag: v0.5~1563 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ca610c0152f31847ab760fda1fb147692f31e7e;p=platform%2Fupstream%2Flibav.git Allocate and clear FF_INPUT_BUFFER_PADDING_SIZE bytes at the end of mkv extradata. Fixes valgrind invalid read warnings during H.264 extradata parsing. Originally committed as revision 16229 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 5a79712..6478d84 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1304,7 +1304,8 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->extradata = extradata; st->codec->extradata_size = extradata_size; } else if(track->codec_priv.data && track->codec_priv.size > 0){ - st->codec->extradata = av_malloc(track->codec_priv.size); + st->codec->extradata = av_mallocz(track->codec_priv.size + + FF_INPUT_BUFFER_PADDING_SIZE); if(st->codec->extradata == NULL) return AVERROR(ENOMEM); st->codec->extradata_size = track->codec_priv.size;