profile=BlobToStringInfo(GetBlobStreamData(buff),(size_t)
GetBlobSize(buff));
if (profile == (StringInfo *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ blob=DetachBlob(buff->blob);
+ blob=RelinquishMagickMemory(blob);
+ buff=DestroyImage(buff);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
status=SetImageProfile(image,"8bim",profile,exception);
profile=DestroyStringInfo(profile);
if (status == MagickFalse)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ 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);
profile=BlobToStringInfo(GetBlobStreamData(buff),(size_t)
GetBlobSize(buff));
if (profile == (StringInfo *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ blob=DetachBlob(buff->blob);
+ blob=RelinquishMagickMemory(blob);
+ buff=DestroyImage(buff);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
status=SetImageProfile(image,name,profile,exception);
profile=DestroyStringInfo(profile);
if (status == MagickFalse)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ blob=DetachBlob(buff->blob);
+ blob=RelinquishMagickMemory(blob);
+ buff=DestroyImage(buff);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
blob=DetachBlob(buff->blob);
blob=RelinquishMagickMemory(blob);
buff=DestroyImage(buff);
profile=BlobToStringInfo(GetBlobStreamData(buff),(size_t)
GetBlobSize(buff));
if (profile == (StringInfo *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ blob=DetachBlob(buff->blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
+ buff=DestroyImage(buff);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
(void) SetImageProfile(image,"icc",profile,exception);
profile=DestroyStringInfo(profile);
blob=DetachBlob(buff->blob);
profile=BlobToStringInfo(GetBlobStreamData(buff),(size_t)
GetBlobSize(buff));
if (profile == (StringInfo *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ blob=DetachBlob(buff->blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
+ buff=DestroyImage(buff);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
(void) SetImageProfile(image,"8bim",profile,exception);
profile=DestroyStringInfo(profile);
blob=DetachBlob(buff->blob);
profile=BlobToStringInfo(GetBlobStreamData(buff),(size_t)
GetBlobSize(buff));
if (profile == (StringInfo *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ blob=DetachBlob(buff->blob);
+ blob=(unsigned char *) RelinquishMagickMemory(blob);
+ buff=DestroyImage(buff);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
(void) SetImageProfile(image,"xmp",profile,exception);
profile=DestroyStringInfo(profile);
blob=DetachBlob(buff->blob);