From 240badc66ad6c1c5f5fe3b7177d56ecd4e5a150f Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 11 Feb 2017 10:33:22 +0100 Subject: [PATCH] Added missing null check. --- coders/psd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/coders/psd.c b/coders/psd.c index e29abf86e..2141652db 100644 --- a/coders/psd.c +++ b/coders/psd.c @@ -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); -- 2.40.0