DeleteImageFromList(&image2);
}
if (clone_info != (ImageInfo *) NULL)
- DestroyImageInfo(clone_info);
+ clone_info=DestroyImageInfo(clone_info);
ThrowReaderException(CoderError,"UnsupportedCellTypeInTheMatrix");
}
DisableMSCWarning(4127)
if (sizeof(double) != 8)
RestoreMSCWarning
- ThrowReaderException(CoderError, "IncompatibleSizeOfDouble");
+ {
+ if (clone_info != (ImageInfo *) NULL)
+ clone_info=DestroyImageInfo(clone_info);
+ if ((image != image2) && (image2 != (Image *) NULL))
+ image2=DestroyImage(image2);
+ ThrowReaderException(CoderError, "IncompatibleSizeOfDouble");
+ }
if (MATLAB_HDR.StructureFlag & FLAG_COMPLEX)
{ /* complex double type cell */
}
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
{
+ if (clone_info != (ImageInfo *) NULL)
+ clone_info=DestroyImageInfo(clone_info);
if ((image != image2) && (image2 != (Image *) NULL))
image2=DestroyImage(image2);
return(DestroyImageList(image));
(void) SetImageBackgroundColor(image,exception);
quantum_info=AcquireQuantumInfo(clone_info,image);
if (quantum_info == (QuantumInfo *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ if (clone_info != (ImageInfo *) NULL)
+ clone_info=DestroyImageInfo(clone_info);
+ if ((image != image2) && (image2 != (Image *) NULL))
+ image2=DestroyImage(image2);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
/* ----- Load raster data ----- */
BImgBuff = (unsigned char *) AcquireQuantumMemory((size_t) (ldblk),sizeof(double)); /* Ldblk was set in the check phase */
if (BImgBuff == NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ if (clone_info != (ImageInfo *) NULL)
+ clone_info=DestroyImageInfo(clone_info);
+ if ((image != image2) && (image2 != (Image *) NULL))
+ image2=DestroyImage(image2);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
(void) memset(BImgBuff,0,ldblk*sizeof(double));
MinVal = 0;