]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/616
authorCristy <urban-warrior@imagemagick.org>
Tue, 25 Jul 2017 12:31:17 +0000 (08:31 -0400)
committerCristy <urban-warrior@imagemagick.org>
Tue, 25 Jul 2017 12:31:17 +0000 (08:31 -0400)
coders/mat.c

index 1bacb1c0763a701a27b313d6aac3465f273e7fa1..5a5325dc8500c254ead67c2ee376f5110877e3d7 100644 (file)
@@ -998,7 +998,12 @@ MATLAB_KO:
          if (Frames == 0)
            ThrowReaderException(CorruptImageError,"ImproperImageHeader");
          break;
-      default: ThrowReaderException(CoderError, "MultidimensionalMatricesAreNotSupported");
+      default:
+        if (clone_info != (ImageInfo *) NULL)
+          clone_info=DestroyImageInfo(clone_info);
+        if ((image != image2) && (image2 != (Image *) NULL))
+          image2=DestroyImage(image2);
+        ThrowReaderException(CoderError, "MultidimensionalMatricesAreNotSupported");
     }
 
     MATLAB_HDR.Flag1 = ReadBlobXXXShort(image2);