]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <urban-warrior@imagemagick.org>
Sun, 13 May 2018 23:15:05 +0000 (19:15 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sun, 13 May 2018 23:15:05 +0000 (19:15 -0400)
coders/mat.c

index 3af3c7e0e3ca74b833ef20507361a85049d640c2..b11c065db8737a9f7f5de59d66ba449a8e9e931b 100644 (file)
@@ -984,9 +984,13 @@ MATLAB_KO:
     }
 #endif
 
-    if (MATLAB_HDR.DataType!=miMATRIX)
+    if (MATLAB_HDR.DataType != miMATRIX)
       {
         clone_info=DestroyImageInfo(clone_info);
+#if defined(MAGICKCORE_ZLIB_DELEGATE)
+        if (image2 != image)
+          DeleteImageFromList(&image2);
+#endif
         continue;  /* skip another objects. */
       }
 
@@ -1074,7 +1078,7 @@ MATLAB_KO:
         MATLAB_HDR.StructureClass != mxINT64_CLASS &&
         MATLAB_HDR.StructureClass != mxUINT64_CLASS)    /* uint64 + uint64 3D */
       {
-        if ((image2 != (Image*) NULL) && (image2 != (Image *) image))
+        if (image2 != (Image*) NULL)
           {
             CloseBlob(image2);
             DeleteImageFromList(&image2);