From: Cristy Date: Thu, 1 Mar 2018 12:41:01 +0000 (-0500) Subject: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6628 X-Git-Tag: 7.0.7-25~28 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5230d90184c1597f55558c1f3a420d4e871095e7;p=imagemagick https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6628 --- diff --git a/coders/miff.c b/coders/miff.c index 456bdb7e4..c79e2b657 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -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);