option=GetImageOption(image_info,"jpeg:colors");
if (option != (const char *) NULL)
if (AcquireImageColormap(image,StringToUnsignedLong(option),exception) == MagickFalse)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ jpeg_destroy_decompress(&jpeg_info);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
if ((jpeg_info.output_components == 1) && (jpeg_info.quantize_colors == 0))
{
size_t
colors=(size_t) GetQuantumRange(image->depth)+1;
if (AcquireImageColormap(image,colors,exception) == MagickFalse)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ jpeg_destroy_decompress(&jpeg_info);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
}
if (image->debug != MagickFalse)
{