]> granicus.if.org Git - imagemagick/commitdiff
Fixed issue with colormap when reading viff image.
authordirk <dirk@git.imagemagick.org>
Thu, 19 Sep 2013 19:03:25 +0000 (19:03 +0000)
committerdirk <dirk@git.imagemagick.org>
Thu, 19 Sep 2013 19:03:25 +0000 (19:03 +0000)
coders/viff.c

index 83334b2c3061262298cdd02d500a23a13e3baf4c..75c81c135b4eaa199c1a97bdd4cab27a32512d6d 100644 (file)
@@ -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");
           }