From 90ac7bb8ae4c3db31dea1b8eaa35fece9d8eb1c2 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 26 Feb 2019 12:01:00 -0500 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1492 --- MagickCore/profile.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/MagickCore/profile.c b/MagickCore/profile.c index 23a09de27..f5c98f4e5 100644 --- a/MagickCore/profile.c +++ b/MagickCore/profile.c @@ -147,9 +147,6 @@ typedef struct _CMSExceptionInfo ExceptionInfo *exception; - - size_t - signature; } CMSExceptionInfo; /* @@ -433,7 +430,8 @@ static cmsHTRANSFORM *DestroyTransformThreadSet(cmsHTRANSFORM *transform) static cmsHTRANSFORM *AcquireTransformThreadSet(Image *image, const cmsHPROFILE source_profile,const cmsUInt32Number source_type, const cmsHPROFILE target_profile,const cmsUInt32Number target_type, - const int intent,const cmsUInt32Number flags) + const int intent,const cmsUInt32Number flags, + CMSExceptionInfo *cms_exception) { cmsHTRANSFORM *transform; @@ -452,8 +450,8 @@ static cmsHTRANSFORM *AcquireTransformThreadSet(Image *image, (void) memset(transform,0,number_threads*sizeof(*transform)); for (i=0; i < (ssize_t) number_threads; i++) { - transform[i]=cmsCreateTransformTHR((cmsContext) image,source_profile, - source_type,target_profile,target_type,intent,flags); + transform[i]=cmsCreateTransformTHR((cmsContext) cms_exception, + source_profile,source_type,target_profile,target_type,intent,flags); if (transform[i] == (cmsHTRANSFORM) NULL) return(DestroyTransformThreadSet(transform)); } @@ -477,8 +475,6 @@ static void CMSExceptionHandler(cmsContext context,cmsUInt32Number severity, cms_exception=(CMSExceptionInfo *) context; if (cms_exception == (CMSExceptionInfo *) NULL) return; - if (cms_exception->signature != MagickCoreSignature) - return; exception=cms_exception->exception; if (exception == (ExceptionInfo *) NULL) return; @@ -892,7 +888,6 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, cmsSetLogErrorHandler(CMSExceptionHandler); cms_exception.image=image; cms_exception.exception=exception; - cms_exception.signature=MagickCoreSignature; (void) cms_exception; source_profile=cmsOpenProfileFromMemTHR((cmsContext) &cms_exception, GetStringInfoDatum(profile),(cmsUInt32Number) @@ -1139,7 +1134,8 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, flags|=cmsFLAGS_BLACKPOINTCOMPENSATION; #endif transform=AcquireTransformThreadSet(image,source_profile, - source_type,target_profile,target_type,intent,flags); + source_type,target_profile,target_type,intent,flags, + &cms_exception); if (transform == (cmsHTRANSFORM *) NULL) ThrowProfileException(ImageError,"UnableToCreateColorTransform", name); -- 2.40.0