ico: reject icon entries that are smaller than sizeof(BITMAPHEADER)
authorPeter Ross <pross@xvid.org>
Thu, 12 Jan 2012 12:42:05 +0000 (23:42 +1100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 12 Jan 2012 15:32:55 +0000 (16:32 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/icodec.c

index 9318c16..d53c33a 100644 (file)
@@ -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);