From: Dirk Lemstra Date: Sat, 11 Feb 2017 09:33:22 +0000 (+0100) Subject: Added missing null check. X-Git-Tag: 7.0.4-8~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=240badc66ad6c1c5f5fe3b7177d56ecd4e5a150f;p=imagemagick Added missing null check. --- 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);