Mercurial > libavformat.hg
changeset 3078:099c8f03c62e libavformat
protect malloc overflow
author | bcoudurier |
---|---|
date | Mon, 25 Feb 2008 12:45:59 +0000 |
parents | 507565d7d611 |
children | 475106eb507e |
files | mov.c |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mov.c Mon Feb 25 12:44:15 2008 +0000 +++ b/mov.c Mon Feb 25 12:45:59 2008 +0000 @@ -291,6 +291,8 @@ len = mp4_read_descr(c, pb, &tag); if (tag == MP4DecSpecificDescrTag) { 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); if (!st->codec->extradata) return AVERROR(ENOMEM);