diff options
author | Peter Ross | 2012-01-12 23:42:05 +1100 |
---|---|---|
committer | Michael Niedermayer | 2012-01-12 16:32:55 +0100 |
commit | 051257495a123ad3883659137e6c8b59d3f4b393 (patch) | |
tree | 5b6abc1595c980d953e4b95422d8dbaad00d4feb /libavformat | |
parent | 90dbd0812731eb1a744b74dcb7a71112ff22db07 (diff) |
ico: reject icon entries that are smaller than sizeof(BITMAPHEADER)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/icodec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/icodec.c b/libavformat/icodec.c index 9318c160dd..d53c33ab0a 100644 --- a/libavformat/icodec.c +++ b/libavformat/icodec.c @@ -94,6 +94,8 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->height = 0; break; case 40: + if (ico->images[i].size < 40) + return AVERROR_INVALIDDATA; st->codec->codec_id = CODEC_ID_BMP; if (!st->codec->width || !st->codec->height) { st->codec->width = avio_rl32(pb); |