]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/878
authorCristy <urban-warrior@imagemagick.org>
Fri, 24 Nov 2017 14:23:04 +0000 (09:23 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 24 Nov 2017 14:23:04 +0000 (09:23 -0500)
coders/mat.c

index efe08943a502c9c22214cacb29b9e51316ac7c1e..5e281111c44a37b90b8a3648d53d537eb0496b44 100644 (file)
@@ -1053,7 +1053,16 @@ MATLAB_KO:
         MATLAB_HDR.StructureClass != mxUINT32_CLASS &&    /* uint32 + uint32 3D */
         MATLAB_HDR.StructureClass != mxINT64_CLASS &&
         MATLAB_HDR.StructureClass != mxUINT64_CLASS)    /* uint64 + uint64 3D */
-      ThrowReaderException(CoderError,"UnsupportedCellTypeInTheMatrix");
+      {
+        if ((image2 != (Image*) NULL) && (image2 != (Image *) image))
+          {
+            CloseBlob(image2);
+            DeleteImageFromList(&image2);
+          }
+        if (clone_info != (ImageInfo *) NULL)
+          DestroyImageInfo(clone_info);
+        ThrowReaderException(CoderError,"UnsupportedCellTypeInTheMatrix");
+      }
 
     switch (MATLAB_HDR.NameFlag)
     {