{ \
if (data != (unsigned char *) NULL) \
data=(unsigned char *) RelinquishMagickMemory(data); \
+ if (graymap != (int *) NULL) \
+ graymap=(int *) RelinquishMagickMemory(graymap); \
+ if (bluemap != (int *) NULL) \
+ bluemap=(int *) RelinquishMagickMemory(bluemap); \
+ if (greenmap != (int *) NULL) \
+ greenmap=(int *) RelinquishMagickMemory(greenmap); \
+ if (redmap != (int *) NULL) \
+ redmap=(int *) RelinquishMagickMemory(redmap); \
if (stream_info != (DCMStreamInfo *) NULL) \
stream_info=(DCMStreamInfo *) RelinquishMagickMemory(stream_info); \
ThrowReaderException((exception),(message)); \
Read DCM preamble.
*/
data=(unsigned char *) NULL;
+ graymap=(int *) NULL;
+ redmap=(int *) NULL;
+ greenmap=(int *) NULL;
+ bluemap=(int *) NULL;
stream_info=(DCMStreamInfo *) AcquireMagickMemory(sizeof(*stream_info));
if (stream_info == (DCMStreamInfo *) NULL)
ThrowDCMException(ResourceLimitError,"MemoryAllocationFailed");
{
offset=SeekBlob(image,scanlines[image->rows-y-1],SEEK_SET);
if (offset < 0)
- ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ {
+ scanlines=(MagickOffsetType *) RelinquishMagickMemory(scanlines);
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ }
for (channel=0; channel < (int) rla_info.number_channels; channel++)
{
length=ReadBlobMSBSignedShort(image);
if (status == MagickFalse)
break;
}
+ scanlines=(MagickOffsetType *) RelinquishMagickMemory(scanlines);
if (EOFBlob(image) != MagickFalse)
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
image->filename);
- scanlines=(MagickOffsetType *) RelinquishMagickMemory(scanlines);
(void) CloseBlob(image);
return(GetFirstImageInList(image));
}