File ImageMagick-CVE-2020-21679.patch of Package ImageMagick.30956

Index: ImageMagick-6.8.8-1/coders/pcx.c
===================================================================
--- ImageMagick-6.8.8-1.orig/coders/pcx.c
+++ ImageMagick-6.8.8-1/coders/pcx.c
@@ -996,7 +996,8 @@ static MagickBooleanType WritePCXImage(c
           pcx_info.planes++;
       }
     length=(((size_t) image->columns*pcx_info.bits_per_pixel+7)/8);
-    if (length > 65535UL)
+    if ((image->columns > 65535UL) || (image->rows > 65535UL) ||
+        (length > 65535UL))
     {
       if (page_table != (MagickOffsetType *) NULL)
         page_table=(MagickOffsetType *) RelinquishMagickMemory(page_table); 
openSUSE Build Service is sponsored by