From: Cristy Date: Tue, 26 Feb 2019 17:01:00 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/1492 X-Git-Tag: 7.0.8-29~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90ac7bb8ae4c3db31dea1b8eaa35fece9d8eb1c2;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1492 --- 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);