if (profile == (StringInfo *) NULL)
{
blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
status=SetImageProfile(image,"8bim",profile,exception);
profile=DestroyStringInfo(profile);
- if (status == MagickFalse)
- {
- blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
- buff=DestroyImage(buff);
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- }
blob=DetachBlob(buff->blob);
blob=(unsigned char *) RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
+ if (status == MagickFalse)
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
if (LocaleNCompare(image_info->magick,"APP1",4) == 0)
{
if (image_info->profile == (void *) NULL)
{
blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
ThrowReaderException(CoderError,"NoIPTCProfileAvailable");
}
if (iptc == (Image *) NULL)
{
blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
GetStringInfoLength(profile));
result=jpeg_embed(image,buff,iptc);
blob=DetachBlob(iptc->blob);
- blob=RelinquishMagickMemory(blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
iptc=DestroyImage(iptc);
if (result == 0)
{
- blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
ThrowReaderException(CoderError,"JPEGEmbeddingFailed");
}
if (profile == (StringInfo *) NULL)
{
blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
status=SetImageProfile(image,name,profile,exception);
profile=DestroyStringInfo(profile);
- if (status == MagickFalse)
- {
- blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
- buff=DestroyImage(buff);
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- }
blob=DetachBlob(buff->blob);
- blob=RelinquishMagickMemory(blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
+ if (status == MagickFalse)
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
if ((LocaleCompare(image_info->magick,"ICC") == 0) ||
(LocaleCompare(image_info->magick,"ICM") == 0))