Browse Source

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
tags/v0.5
Alexander Strange 17 years ago
parent
commit
1ca610c015
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      libavformat/matroskadec.c

+ 2
- 1
libavformat/matroskadec.c View File

@@ -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;


Loading…
Cancel
Save