From: Cristy Date: Fri, 9 Feb 2018 00:43:26 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/956 X-Git-Tag: 7.0.7-23~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=73fbc6a557b4f63af18b2debe83f817859ef7481;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/956 --- diff --git a/coders/sun.c b/coders/sun.c index b36a9ea23..fe6277de9 100644 --- a/coders/sun.c +++ b/coders/sun.c @@ -344,6 +344,8 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception) image->colors=one << sun_info.depth; if (sun_info.maptype == RMT_EQUAL_RGB) image->colors=sun_info.maplength/3; + if (image->colors == 0) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); }