]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 16 Sep 2013 22:31:00 +0000 (22:31 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 16 Sep 2013 22:31:00 +0000 (22:31 +0000)
coders/gif.c
coders/psd.c

index 5a44f5b306d51cc794fa414cde442040f0a406fa..98776d489394a0e8dc10da15f6151c4fdb334626 100644 (file)
@@ -456,45 +456,47 @@ static MagickBooleanType DecodeImage(Image *image,const ssize_t opacity,
     if (image->interlace == NoInterlace)
       offset++;
     else
-      switch (pass)
       {
-        case 0:
-        default:
+        switch (pass)
         {
-          offset+=8;
-          if (offset >= (ssize_t) image->rows)
-            {
-              pass++;
-              offset=4;
-            }
-          break;
+          case 0:
+          default:
+          {
+            offset+=8;
+            break;
+          }
+          case 1:
+          {
+            offset+=8;
+            break;
+          }
+          case 2:
+          {
+            offset+=4;
+            break;
+          }
+          case 3:
+          {
+            offset+=2;
+            break;
+          }
         }
-        case 1:
+      if ((pass == 0) && (offset >= (ssize_t) image->rows))
         {
-          offset+=8;
-          if (offset >= (ssize_t) image->rows)
-            {
-              pass++;
-              offset=2;
-            }
-          break;
+          pass++;
+          offset=4;
         }
-        case 2:
+      if ((pass == 1) && (offset >= (ssize_t) image->rows))
         {
-          offset+=4;
-          if (offset >= (ssize_t) image->rows)
-            {
-              pass++;
-              offset=1;
-            }
-          break;
+          pass++;
+          offset=2;
         }
-        case 3:
+      if ((pass == 2) && (offset >= (ssize_t) image->rows))
         {
-          offset+=2;
-          break;
+          pass++;
+          offset=1;
         }
-      }
+    }
   }
   lzw_info=RelinquishLZWInfo(lzw_info);
   if (y < (ssize_t) image->rows)
index 3cd841a54b780e5d07ec856520a9d4460140be6d..b58c3cc5f9498759cfcf87133b6ba44e3ffc2ab0 100644 (file)
@@ -849,7 +849,7 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
       (psd_info.mode == DuotoneMode))
     {
       psd_info.color_channels=1;
-      if (AcquireImageColormap(image,256,exception) == MagickFalse)
+      if (AcquireImageColormap(image,psd_info.depth != 16 ? 256 : 65536,exception) == MagickFalse)
         ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
       image->alpha_trait=psd_info.channels >= 2 ? BlendPixelTrait : 
         UndefinedPixelTrait;