]> granicus.if.org Git - imagemagick/commitdiff
...
authorCristy <mikayla-grace@urban-warrior.org>
Mon, 29 Apr 2019 00:45:43 +0000 (20:45 -0400)
committerCristy <mikayla-grace@urban-warrior.org>
Mon, 29 Apr 2019 00:45:43 +0000 (20:45 -0400)
coders/mat.c

index 8d704fde29f1e3468bbf53aa08dcfb9529f47e88..e1c4961ae1ab8bc7828d28df42fad0342f21ad98 100644 (file)
@@ -1277,8 +1277,14 @@ RestoreMSCWarning
           {
             if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
               "  MAT cannot read scanrow %u from a file.", (unsigned)(MATLAB_HDR.SizeY-i-1));
+           if ((image != image2) && (image2 != (Image *) NULL))
+              image2=DestroyImage(image2);
+            if (clone_info != (ImageInfo *) NULL)
+              clone_info=DestroyImageInfo(clone_info);
+            if (quantum_info != (QuantumInfo *) NULL)
+              quantum_info=DestroyQuantumInfo(quantum_info);
+            BImgBuff=RelinquishMagickMemory(BImgBuff);
             ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile");
-            goto ExitLoop;
           }
         if((CellType==miINT8 || CellType==miUINT8) && (MATLAB_HDR.StructureFlag & FLAG_LOGICAL))
         {