https://github.com/ImageMagick/ImageMagick/issues/599
diff --git a/coders/mat.c b/coders/mat.c
index 6b08f76..14dde7d 100644
--- a/coders/mat.c
+++ b/coders/mat.c
@@ -933,7 +933,8 @@
   if (strncmp(MATLAB_HDR.identific, "MATLAB", 6))
     {
 MATLAB_KO:
-      clone_info=DestroyImageInfo(clone_info);
+      if (clone_info != (ImageInfo *) NULL)
+        clone_info=DestroyImageInfo(clone_info);
       ThrowReaderException(CorruptImageError,"ImproperImageHeader");
     }