From b954cc8ac3a5295a86d1c122eb0035785bac2e63 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Tue, 2 Jul 2019 23:05:26 +0200 Subject: [PATCH] Added missing check. --- coders/psd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coders/psd.c b/coders/psd.c index b2fa02878..5bbaed51a 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -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 : -- 2.40.0