From ff3faa31166439d81b72de22daea2b6404569137 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 23 Jul 2017 10:35:56 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/601 --- coders/mat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coders/mat.c b/coders/mat.c index cd8f0c72f..6b08f765e 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -1093,6 +1093,10 @@ RestoreMSCWarning ldblk = (ssize_t) (8 * MATLAB_HDR.SizeX); break; default: + if ((image != image2) && (image2 != (Image *) NULL)) + image2=DestroyImage(image2); + if (clone_info) + clone_info=DestroyImageInfo(clone_info); ThrowReaderException(CoderError, "UnsupportedCellTypeInTheMatrix"); } (void) sample_size; -- 2.40.0