From: Cristy Date: Thu, 6 Jul 2017 10:17:54 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/545 X-Git-Tag: 7.0.6-1~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30a74ed25a4890acfa94f452d653d54c9628c87e;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/545 --- diff --git a/coders/miff.c b/coders/miff.c index 7a0cdc7f2..6bac4b054 100644 --- a/coders/miff.c +++ b/coders/miff.c @@ -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");