extradata may be used as bitstream reader input so allocate with padding

Originally committed as revision 5547 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2006-06-29 19:42:34 +00:00
parent 25c533a2c2
commit 62c52121e0
1 changed files with 2 additions and 1 deletions

View File

@ -1995,8 +1995,9 @@ int av_find_stream_info(AVFormatContext *ic)
int i= st->parser->parser->split(st->codec, pkt->data, pkt->size);
if(i){
st->codec->extradata_size= i;
st->codec->extradata= av_malloc(st->codec->extradata_size);
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size);
memset(st->codec->extradata + i, 0, FF_INPUT_BUFFER_PADDING_SIZE);
}
}