From: Cristy Date: Tue, 25 Jul 2017 12:31:17 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/616 X-Git-Tag: 7.0.6-4~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a020acbcfea6e53eff6766c87ea175eac9dcd18;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/616 --- diff --git a/coders/mat.c b/coders/mat.c index 1bacb1c07..5a5325dc8 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -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);