aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/icodec.c2
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);