]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/587
authorCristy <urban-warrior@imagemagick.org>
Tue, 18 Jul 2017 22:28:29 +0000 (18:28 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 18 Jul 2017 22:28:29 +0000 (18:28 -0400)
coders/mat.c

index 240cedf79d6f3dbf26c0e67c76efa0ac9e271b95..cd8f0c72f3a1b09f046279d12a0b67738f69866d 100644 (file)
@@ -1350,6 +1350,8 @@ END_OF_READING:
     clone_info = NULL;
   }
   if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),"return");
+  if ((image != image2) && (image2 != (Image *) NULL))
+    image2=DestroyImage(image2);
   if(image==NULL)
     ThrowReaderException(CorruptImageError,"ImproperImageHeader");
   return (image);