Commit c6ba2b84 authored by bcoudurier's avatar bcoudurier

protect malloc overflow

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@12208 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2af72681
...@@ -291,6 +291,8 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom) ...@@ -291,6 +291,8 @@ static int mov_read_esds(MOVContext *c, ByteIOContext *pb, MOV_atom_t atom)
len = mp4_read_descr(c, pb, &tag); len = mp4_read_descr(c, pb, &tag);
if (tag == MP4DecSpecificDescrTag) { if (tag == MP4DecSpecificDescrTag) {
dprintf(c->fc, "Specific MPEG4 header len=%d\n", len); dprintf(c->fc, "Specific MPEG4 header len=%d\n", len);
if((uint64_t)len > (1<<30))
return -1;
st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE); st->codec->extradata = av_mallocz(len + FF_INPUT_BUFFER_PADDING_SIZE);
if (!st->codec->extradata) if (!st->codec->extradata)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
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