File ImageMagick-CVE-2020-21679.patch of Package ImageMagick.30356
Index: ImageMagick-7.0.7-34/coders/pcx.c
===================================================================
--- ImageMagick-7.0.7-34.orig/coders/pcx.c
+++ ImageMagick-7.0.7-34/coders/pcx.c
@@ -977,7 +977,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);