From 73fbc6a557b4f63af18b2debe83f817859ef7481 Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 8 Feb 2018 19:43:26 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/956 --- coders/sun.c | 2 ++ 1 file changed, 2 insertions(+) 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"); } -- 2.40.0