From: Dirk Lemstra Date: Wed, 3 May 2017 21:58:25 +0000 (+0200) Subject: Added extra check that was reported in #466. X-Git-Tag: 7.0.5-6~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b3299a3f2ec597172b092e9f7b71d2c9e75287c7;p=imagemagick Added extra check that was reported in #466. --- diff --git a/coders/icon.c b/coders/icon.c index 5e854d0cb..67883b166 100644 --- a/coders/icon.c +++ b/coders/icon.c @@ -432,7 +432,7 @@ static Image *ReadICONImage(const ImageInfo *image_info, { image->storage_class=PseudoClass; image->colors=icon_info.number_colors; - if (image->colors == 0) + if ((image->colors == 0) || (image->colors > 256)) image->colors=one << icon_info.bits_per_pixel; } if (image->storage_class == PseudoClass)