Commit bc99797f authored by reimar's avatar reimar

Check for failed extradata malloc, fixes a crash in out-of-memory conditions

or with extremely large extradata.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19333 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 12eccfe2
......@@ -483,6 +483,10 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
if(size > 10*4 && size<(1<<30)){
st->codec->extradata_size= size - 10*4;
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata) {
st->codec->extradata_size= 0;
return AVERROR(ENOMEM);
}
get_buffer(pb, st->codec->extradata, st->codec->extradata_size);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment