File ImageMagick-WritePCXImage-page_table-memory-leak.patch of Package ImageMagick.11105

Index: ImageMagick-7.0.7-34/coders/pcx.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/pcx.c	2018-05-20 17:55:43.000000000 +0200
+++ ImageMagick-7.0.7-34/coders/pcx.c	2018-10-11 10:35:54.590223364 +0200
@@ -978,7 +978,11 @@ static MagickBooleanType WritePCXImage(c
       }
     length=(((size_t) image->columns*pcx_info.bits_per_pixel+7)/8);
     if (length > 65535UL)
-      ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
+      {
+        if (page_table != (MagickOffsetType *) NULL)
+          page_table=(MagickOffsetType *) RelinquishMagickMemory(page_table);
+        ThrowWriterException(ImageError,"WidthOrHeightExceedsLimit");
+      }
     pcx_info.bytes_per_line=(unsigned short) length;
     pcx_info.palette_info=1;
     pcx_info.colormap_signature=0x0c;
openSUSE Build Service is sponsored by