]> granicus.if.org Git - imagemagick/commitdiff
Added missing check.
authorDirk Lemstra <dirk@lemstra.org>
Tue, 2 Jul 2019 21:05:26 +0000 (23:05 +0200)
committerDirk Lemstra <dirk@lemstra.org>
Tue, 2 Jul 2019 21:05:26 +0000 (23:05 +0200)
coders/psd.c

index b2fa0287851d145e883ba69480e2f99134d66ab7..5bbaed51a1adb41c7319781b75a65bf6ecb83f85 100644 (file)
@@ -2917,7 +2917,8 @@ static size_t WritePSDChannels(const PSDInfo *psd_info,
   channels=1;
   if (separate == MagickFalse)
     {
-      if (next_image->storage_class != PseudoClass)
+      if ((next_image->storage_class != PseudoClass) ||
+          (IsImageGray(next_image) != MagickFalse))
         {
           if (IsImageGray(next_image) == MagickFalse)
             channels=(size_t) (next_image->colorspace == CMYKColorspace ? 4 :