]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1453
authorCristy <mikayla-grace@urban-warrior.org>
Sun, 20 Jan 2019 15:55:06 +0000 (10:55 -0500)
committerCristy <mikayla-grace@urban-warrior.org>
Sun, 20 Jan 2019 15:55:06 +0000 (10:55 -0500)
coders/bmp.c

index e0724252ae23791393d2d4a1408ac337eca69952..d49a52b9f9f6cbcf48197e7ebc12209ebf20f32c 100644 (file)
@@ -2314,7 +2314,10 @@ static MagickBooleanType WriteBMPImage(const ImageInfo *image_info,Image *image,
         bmp_colormap=(unsigned char *) AcquireQuantumMemory((size_t) (1UL <<
           bmp_info.bits_per_pixel),4*sizeof(*bmp_colormap));
         if (bmp_colormap == (unsigned char *) NULL)
-          ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+          {
+            pixel_info=RelinquishVirtualMemory(pixel_info);
+            ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
+          }
         q=bmp_colormap;
         for (i=0; i < (ssize_t) MagickMin((ssize_t) image->colors,(ssize_t) bmp_info.number_colors); i++)
         {