buffer=(unsigned char *) AcquireQuantumMemory(MagickMaxBufferExtent,
sizeof(*buffer));
if (buffer == (unsigned char *) NULL)
- ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ {
+ jbg_dec_free(&jbig_info);
+ ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ }
status=JBG_EAGAIN;
do
{
image->compression=JBIG2Compression;
if (AcquireImageColormap(image,2,exception) == MagickFalse)
{
+ jbg_dec_free(&jbig_info);
buffer=(unsigned char *) RelinquishMagickMemory(buffer);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
image->resolution.y=300;
if (image_info->ping != MagickFalse)
{
+ jbg_dec_free(&jbig_info);
+ buffer=(unsigned char *) RelinquishMagickMemory(buffer);
(void) CloseBlob(image);
return(GetFirstImageInList(image));
}
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
- return(DestroyImageList(image));
+ {
+ jbg_dec_free(&jbig_info);
+ buffer=(unsigned char *) RelinquishMagickMemory(buffer);
+ return(DestroyImageList(image));
+ }
/*
Convert X bitmap image to pixel packets.
*/