]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 8 Apr 2010 14:21:08 +0000 (14:21 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 8 Apr 2010 14:21:08 +0000 (14:21 +0000)
magick/profile.c

index 2bea557f8926548a1d1a43e52c5db64a5c149223..a34f5b94a2c198c3ad91a079d513d32bd7656f4d 100644 (file)
@@ -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)