From: dirk Date: Thu, 19 Sep 2013 19:03:25 +0000 (+0000) Subject: Fixed issue with colormap when reading viff image. X-Git-Tag: 7.0.1-0~3301 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=549cd1fa6b9a51ac41f29a461b90d95127a03830;p=imagemagick Fixed issue with colormap when reading viff image. --- diff --git a/coders/viff.c b/coders/viff.c index 83334b2c3..75c81c135 100644 --- a/coders/viff.c +++ b/coders/viff.c @@ -391,9 +391,12 @@ static Image *ReadVIFFImage(const ImageInfo *image_info, /* Create linear color ramp. */ - image->colors=image->depth <= 8 ? 256UL : 65536UL; if (viff_info.data_storage_type == VFF_TYP_BIT) image->colors=2; + else if (viff_info.data_storage_type == VFF_MAPTYP_1_BYTE) + image->colors=256UL; + else + image->colors=image->depth <= 8 ? 256UL : 65536UL; if (AcquireImageColormap(image,image->colors,exception) == MagickFalse) ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); }