]> granicus.if.org Git - imagemagick/commitdiff
Added missing null check.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sat, 11 Feb 2017 09:33:22 +0000 (10:33 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sat, 11 Feb 2017 09:33:43 +0000 (10:33 +0100)
coders/psd.c

index e29abf86ec715a6e605b695aa2ef6232b7e9f6c6..2141652db0ceba86a7d3f023e46df147528aa4a8 100644 (file)
@@ -1306,8 +1306,11 @@ static MagickBooleanType ReadPSDChannel(Image *image,
       }
       mask=CloneImage(image,layer_info->mask.page.width,
         layer_info->mask.page.height,MagickFalse,exception);
-      SetImageType(mask,GrayscaleType,exception);
-      channel_image=mask;
+      if (mask != (Image *) NULL)
+        {
+          SetImageType(mask,GrayscaleType,exception);
+          channel_image=mask;
+        }
     }
 
   offset=TellBlob(image);