From 7a020acbcfea6e53eff6766c87ea175eac9dcd18 Mon Sep 17 00:00:00 2001 From: Cristy Date: Tue, 25 Jul 2017 08:31:17 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/616 --- coders/mat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); -- 2.40.0