]> granicus.if.org Git - imagemagick/commitdiff
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6628
authorCristy <urban-warrior@imagemagick.org>
Thu, 1 Mar 2018 12:41:01 +0000 (07:41 -0500)
committerCristy <urban-warrior@imagemagick.org>
Thu, 1 Mar 2018 12:41:01 +0000 (07:41 -0500)
coders/miff.c

index 456bdb7e46de98a23491bfb9902ad7e77b231c93..c79e2b657782f0c6f74fb5a47260b9ec0f85f0f9 100644 (file)
@@ -1180,6 +1180,8 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
           Create image colormap.
         */
         packet_size=(size_t) (3UL*image->depth/8UL);
+        if ((MagickSizeType) colors > GetBlobSize(image))
+          ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
         if (((MagickSizeType) packet_size*colors) > GetBlobSize(image))
           ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
         status=AcquireImageColormap(image,colors != 0 ? colors : 256,exception);