From 30a74ed25a4890acfa94f452d653d54c9628c87e Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 6 Jul 2017 06:17:54 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/545 --- coders/miff.c | 2 ++ 1 file changed, 2 insertions(+) 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"); -- 2.40.0