From 9b92589094b9e26ec77d13183c69ffde636e1bd2 Mon Sep 17 00:00:00 2001 From: dirk Date: Wed, 6 Jul 2016 07:02:44 +0200 Subject: [PATCH] Added check to make sure that the context is not null. --- MagickCore/profile.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MagickCore/profile.c b/MagickCore/profile.c index 51d887902..bc8b8d70f 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -435,9 +435,13 @@ static void CMSExceptionHandler(cmsContext context,cmsUInt32Number severity, Image *image; + image=(Image *) NULL; cms_exception=(CMSExceptionInfo *) context; - image=cms_exception->image; - exception=cms_exception->exception; + if (cms_exception != (CMSExceptionInfo *) NULL) + { + image=cms_exception->image; + exception=cms_exception->exception; + } if (image == (Image *) NULL) { (void) ThrowMagickException(exception,GetMagickModule(),ImageWarning, -- 2.49.0