From: Cristy Date: Thu, 27 Apr 2017 11:45:09 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.5-6~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79e5dbcdd1fc2f714f9bae548bc55d5073f3ed20;p=imagemagick ... --- diff --git a/coders/mat.c b/coders/mat.c index 1ff235448..48cde36e2 100644 --- a/coders/mat.c +++ b/coders/mat.c @@ -627,6 +627,7 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, depth; + quantum_info=(QuantumInfo *) NULL; (void) SeekBlob(image,0,SEEK_SET); while (EOFBlob(image) != MagickFalse) { @@ -772,7 +773,8 @@ static Image *ReadMATImageV4(const ImageInfo *image_info,Image *image, else InsertComplexFloatRow(image,(float *) pixels,y,0,0,exception); } - quantum_info=DestroyQuantumInfo(quantum_info); + if (quantum_info != (QuantumInfo *) NULL) + quantum_info=DestroyQuantumInfo(quantum_info); rotate_image=RotateImage(image,90.0,exception); if (rotate_image != (Image *) NULL) { @@ -890,6 +892,7 @@ static Image *ReadMATImage(const ImageInfo *image_info,ExceptionInfo *exception) /* Read MATLAB image. */ + quantum_info=(QuantumInfo *) NULL; clone_info=CloneImageInfo(image_info); if (ReadBlob(image,124,(unsigned char *) &MATLAB_HDR.identific) != 124) ThrowReaderException(CorruptImageError,"ImproperImageHeader"); @@ -1290,7 +1293,8 @@ done_reading: } RelinquishMagickMemory(BImgBuff); - quantum_info=DestroyQuantumInfo(quantum_info); + if (quantum_info != (QuantumInfo *) NULL) + quantum_info=DestroyQuantumInfo(quantum_info); END_OF_READING: clone_info=DestroyImageInfo(clone_info); CloseBlob(image);