From: cristy Date: Thu, 8 Apr 2010 14:21:08 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9674 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45e5772bbbb05e90d97aa8b4dd70b62c6ce74f09;p=imagemagick --- diff --git a/magick/profile.c b/magick/profile.c index 2bea557f8..a34f5b94a 100644 --- a/magick/profile.c +++ b/magick/profile.c @@ -1194,7 +1194,8 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, (target_pixels == (unsigned short **) NULL)) { transform=DestroyTransformThreadSet(transform); - (void) cmsCloseProfile(target_profile); + if (target_profile != (cmsHPROFILE) NULL) + (void) cmsCloseProfile(target_profile); ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", image->filename); } @@ -1203,7 +1204,8 @@ MagickExport MagickBooleanType ProfileImage(Image *image,const char *name, target_pixels=DestroyPixelThreadSet(target_pixels); source_pixels=DestroyPixelThreadSet(source_pixels); transform=DestroyTransformThreadSet(transform); - (void) cmsCloseProfile(target_profile); + if (target_profile != (cmsHPROFILE) NULL) + (void) cmsCloseProfile(target_profile); return(MagickFalse); } if (target_colorspace == CMYKColorspace)