switch (image->depth)
{
default:
+ colormap=(unsigned char *) RelinquishMagickMemory(colormap);
ThrowReaderException(CorruptImageError,
"ImageDepthNotSupported");
case 8:
{
status=SetQuantumFormat(image,quantum_info,quantum_format);
if (status == MagickFalse)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
}
packet_size=(size_t) (quantum_info->depth/8);
if (image->storage_class == DirectClass)
compress_pixels=(unsigned char *) AcquireQuantumMemory(compress_extent,
sizeof(*compress_pixels));
if (compress_pixels == (unsigned char *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
/*
Read image pixels.
*/
if (length > compress_extent)
{
(void) BZ2_bzDecompressEnd(&bzip_info);
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ compress_pixels=(unsigned char *) RelinquishMagickMemory(compress_pixels);
ThrowReaderException(CorruptImageError,
"UnableToReadImageData");
}
if (length > compress_extent)
{
lzma_end(&lzma_info);
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ compress_pixels=(unsigned char *) RelinquishMagickMemory(compress_pixels);
ThrowReaderException(CorruptImageError,
"UnableToReadImageData");
}
if (length > compress_extent)
{
(void) inflateEnd(&zip_info);
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ compress_pixels=(unsigned char *) RelinquishMagickMemory(compress_pixels);
ThrowReaderException(CorruptImageError,
"UnableToReadImageData");
}
offset=SeekBlob(image,-((MagickOffsetType)
bzip_info.avail_in),SEEK_CUR);
if (offset < 0)
- ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ {
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ compress_pixels=(unsigned char *) RelinquishMagickMemory(compress_pixels);
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ }
}
code=BZ2_bzDecompressEnd(&bzip_info);
if (code != BZ_OK)
offset=SeekBlob(image,-((MagickOffsetType) zip_info.avail_in),
SEEK_CUR);
if (offset < 0)
- ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ {
+ quantum_info=DestroyQuantumInfo(quantum_info);
+ compress_pixels=(unsigned char *) RelinquishMagickMemory(compress_pixels);
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ }
}
code=inflateEnd(&zip_info);
if (code != LZMA_OK)