Access violation in profile.c

Priya Hariharan <[email protected]> Wed, 03 Jun 2009 12:01:02 +1000
Newsgroups gmane.comp.video.image-magick.bugs
Message-ID <[email protected]>
Hi,

An access violation occurs in the function *ProfileImage* since 
*traget_profile* is accessed after it is freed.
Please find a fix to this problem.

Index: ../magick/profile.c
===================================================================
--- ../magick/profile.c	(revision 9752)
+++ ../magick/profile.c	(working copy)
@@ -1005,7 +1005,6 @@
           transform=cmsCreateTransform(source_profile,source_type,
             target_profile,target_type,intent,flags);
           (void) cmsCloseProfile(source_profile);
-          (void) cmsCloseProfile(target_profile);
           if (transform == (cmsHTRANSFORM) NULL)
             ThrowBinaryException(ImageError,"UnableToCreateColorTransform",
               name);
@@ -1103,6 +1102,7 @@
           source_pixels=(unsigned short *) RelinquishMagickMemory(
             source_pixels);
           cmsDeleteTransform(transform);
+          (void) cmsCloseProfile(target_profile);
         }
 #endif
     }
  

Thanks and Regards,
Priya






-- 
Thanks and Regards,
Priya