}
}
if (ReadRectangle(image,&source) == MagickFalse)
- ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ {
+ tile_image=DestroyImage(tile_image);
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ }
if (ReadRectangle(image,&destination) == MagickFalse)
- ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ {
+ tile_image=DestroyImage(tile_image);
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ }
(void) ReadBlobMSBShort(image);
if ((code == 0x91) || (code == 0x99) || (code == 0x9b))
{
for (y=0; y < (ssize_t) tile_image->rows; y++)
{
if (p > (pixels+extent+image->columns))
- ThrowReaderException(CorruptImageError,"NotEnoughPixelData");
+ {
+ tile_image=DestroyImage(tile_image);
+ ThrowReaderException(CorruptImageError,"NotEnoughPixelData");
+ }
q=QueueAuthenticPixels(tile_image,0,y,tile_image->columns,1,
exception);
if (q == (Quantum *) NULL)
if (tile_image->alpha_trait == UndefinedPixelTrait)
{
if (p > (pixels+extent+2*image->columns))
- ThrowReaderException(CorruptImageError,
- "NotEnoughPixelData");
+ {
+ tile_image=DestroyImage(tile_image);
+ ThrowReaderException(CorruptImageError,
+ "NotEnoughPixelData");
+ }
SetPixelRed(tile_image,ScaleCharToQuantum(*p),q);
SetPixelGreen(tile_image,ScaleCharToQuantum(
*(p+tile_image->columns)),q);
else
{
if (p > (pixels+extent+3*image->columns))
- ThrowReaderException(CorruptImageError,
- "NotEnoughPixelData");
+ {
+ tile_image=DestroyImage(tile_image);
+ ThrowReaderException(CorruptImageError,
+ "NotEnoughPixelData");
+ }
SetPixelAlpha(tile_image,ScaleCharToQuantum(*p),q);
SetPixelRed(tile_image,ScaleCharToQuantum(
*(p+tile_image->columns)),q);
status=SetImageProfile(image,"icc",profile,exception);
profile=DestroyStringInfo(profile);
if (status == MagickFalse)
- ThrowReaderException(ResourceLimitError,
- "MemoryAllocationFailed");
+ {
+ info=(unsigned char *) RelinquishMagickMemory(info);
+ ThrowReaderException(ResourceLimitError,
+ "MemoryAllocationFailed");
+ }
break;
}
case 0x1f2:
SetStringInfoDatum(profile,info);
status=SetImageProfile(image,"iptc",profile,exception);
if (status == MagickFalse)
- ThrowReaderException(ResourceLimitError,
- "MemoryAllocationFailed");
+ {
+ info=(unsigned char *) RelinquishMagickMemory(info);
+ ThrowReaderException(ResourceLimitError,
+ "MemoryAllocationFailed");
+ }
profile=DestroyStringInfo(profile);
break;
}