From 051257495a123ad3883659137e6c8b59d3f4b393 Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Thu, 12 Jan 2012 23:42:05 +1100 Subject: ico: reject icon entries that are smaller than sizeof(BITMAPHEADER) Signed-off-by: Michael Niedermayer --- libavformat/icodec.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat/icodec.c') 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); -- cgit v1.2.3