}
RelinquishMagickResource(MapResource,extent);
}
- if (memory_info->blob == NULL)
+ if ((memory_info->blob == NULL) &&
+ (AcquireMagickResource(MemoryResource,extent) != MagickFalse))
{
memory_info->blob=AcquireMagickMemory(extent);
if (memory_info->blob != NULL)
memory_info->type=UnalignedVirtualMemory;
+ RelinquishMagickResource(MemoryResource,extent);
}
if (memory_info->blob == NULL)
memory_info=RelinquishVirtualMemory(memory_info);
pcx_info.planes=(unsigned char) ReadBlobByte(image);
if (pcx_info.planes == 0)
ThrowPCXException(CorruptImageError,"ImproperImageHeader");
+ if (pcx_info.planes > 6)
+ ThrowPCXException(CorruptImageError,"ImproperImageHeader");
if ((pcx_info.bits_per_pixel*pcx_info.planes) >= 64)
ThrowPCXException(CorruptImageError,"ImproperImageHeader");
one=1;