]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/545
authorCristy <urban-warrior@imagemagick.org>
Thu, 6 Jul 2017 10:17:54 +0000 (06:17 -0400)
committerCristy <urban-warrior@imagemagick.org>
Thu, 6 Jul 2017 10:17:54 +0000 (06:17 -0400)
coders/miff.c

index 7a0cdc7f24f98189351e23fe002dfa45a7bd44b1..6bac4b054c958f7051cda7b6edd8e83fd08266ea 100644 (file)
@@ -1158,6 +1158,8 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
         /*
           Create image colormap.
         */
+        if ((colors*image->depth/8) > GetBlobSize(image))
+          ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
         status=AcquireImageColormap(image,colors != 0 ? colors : 256,exception);
         if (status == MagickFalse)
           ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");