ico: reject icon entries that are smaller than sizeof(BITMAPHEADER)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Peter Ross 2012-01-12 23:42:05 +11:00 committed by Michael Niedermayer
parent 90dbd08127
commit 051257495a

View 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);