]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 18 Jul 2013 22:14:51 +0000 (22:14 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 18 Jul 2013 22:14:51 +0000 (22:14 +0000)
MagickCore/artifact.c
MagickCore/profile.c

index 59ca6dedbe4c522b918971a64696e7ea8601594c..ded06db37493275e73e7582fbd95d9751c383dfb 100644 (file)
@@ -112,8 +112,12 @@ MagickExport MagickBooleanType CloneImageArtifacts(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
       clone_image->filename);
   if (clone_image->artifacts != (void *) NULL)
-    image->artifacts=CloneSplayTree((SplayTreeInfo *) clone_image->artifacts,
-      (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
+    {
+      if (image->artifacts != (void *) NULL)
+        DestroyImageArtifacts(image);
+      image->artifacts=CloneSplayTree((SplayTreeInfo *) clone_image->artifacts,
+        (void *(*)(void *)) ConstantString,(void *(*)(void *)) ConstantString);
+    }
   return(MagickTrue);
 }
 \f
index 1c81f619bb1df8d1b2884205c08b96194f483a05..0b923558468856232854b05124394009368aba61 100644 (file)
@@ -163,8 +163,12 @@ MagickExport MagickBooleanType CloneImageProfiles(Image *image,
   assert(clone_image != (const Image *) NULL);
   assert(clone_image->signature == MagickSignature);
   if (clone_image->profiles != (void *) NULL)
-    image->profiles=CloneSplayTree((SplayTreeInfo *) clone_image->profiles,
-      (void *(*)(void *)) ConstantString,(void *(*)(void *)) CloneStringInfo);
+    {
+      if (image->profiles != (void *) NULL)
+        DestroyImageProfiles(image);
+      image->profiles=CloneSplayTree((SplayTreeInfo *) clone_image->profiles,
+        (void *(*)(void *)) ConstantString,(void *(*)(void *)) CloneStringInfo);
+    }
   return(MagickTrue);
 }
 \f