From: Cristy Date: Sun, 20 Jan 2019 15:49:59 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/1453 X-Git-Tag: 7.0.8-25~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9cf2f738f714eba6d47be1127ed255acd2b51750;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/1453 --- diff --git a/coders/dib.c b/coders/dib.c index 5208e8d6e..72578f108 100644 --- a/coders/dib.c +++ b/coders/dib.c @@ -1377,7 +1377,10 @@ static MagickBooleanType WriteDIBImage(const ImageInfo *image_info,Image *image, dib_colormap=(unsigned char *) AcquireQuantumMemory((size_t) (1UL << dib_info.bits_per_pixel),4*sizeof(*dib_colormap)); if (dib_colormap == (unsigned char *) NULL) - ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + { + pixels=(unsigned char *) RelinquishMagickMemory(pixels); + ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + } q=dib_colormap; for (i=0; i < (ssize_t) MagickMin(image->colors,dib_info.number_colors); i++) {