[FFmpeg-devel] [PATCH 3/3] ico: reject icon entries that are smaller than sizeof(BITMAPHEADER)

Peter Ross pross at xvid.org
Thu Jan 12 13:42:05 CET 2012


---
 libavformat/icodec.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index 9318c16..d53c33a 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);
-- 
1.7.5.4

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120112/3852da78/attachment.asc>


More information about the ffmpeg-devel mailing list