]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 18 May 2014 11:37:46 +0000 (11:37 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 18 May 2014 11:37:46 +0000 (11:37 +0000)
coders/viff.c

index 8ca223deae46271771b548289c28bbe6f3a701f8..7c5855a1a3b625e3e2a53c789121cc7cc264b6d7 100644 (file)
@@ -393,11 +393,13 @@ static Image *ReadVIFFImage(const ImageInfo *image_info,
             */
             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)
+              if (viff_info.data_storage_type == VFF_MAPTYP_1_BYTE)
+                image->colors=256UL;
+              else
+                image->colors=image->depth <= 8 ? 256UL : 65536UL;
+            status=AcquireImageColormap(image,image->colors,exception);
+            if (status == MagickFalse)
               ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
           }
         break;