]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 5 Jan 2015 22:42:52 +0000 (22:42 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 5 Jan 2015 22:42:52 +0000 (22:42 +0000)
coders/icon.c

index 50bfed63c41d6a61fb78ef3c76f245075efc5fbe..cdd143ff2a26c4b7c935edaddbcbbecf06f464df 100644 (file)
@@ -323,6 +323,12 @@ static Image *ReadICONImage(const ImageInfo *image_info,
     icon_info.height=(unsigned char) ((int) ReadBlobLSBLong(image)/2);
     icon_info.planes=ReadBlobLSBShort(image);
     icon_info.bits_per_pixel=ReadBlobLSBShort(image);
+    if (EOFBlob(image) != MagickFalse)
+      {
+        ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+          image->filename);
+        break;
+      }
     if (((icon_info.planes == 18505) && (icon_info.bits_per_pixel == 21060)) || 
         (icon_info.size == 0x474e5089))
       {