Commit d622bd602 for imagemagick.org
commit d622bd6023310d57cec1e8f265095a1979210371
Author: Cristy <urban-warrior@imagemagick.org>
Date: Sun Feb 22 19:01:13 2026 -0500
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-467j-76j7-5885
diff --git a/coders/pcl.c b/coders/pcl.c
index 562a724f1..f6703575a 100644
--- a/coders/pcl.c
+++ b/coders/pcl.c
@@ -833,14 +833,14 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
}
case RLECompression:
{
- compress_pixels=(unsigned char *) AcquireQuantumMemory(length+256,
- sizeof(*compress_pixels));
+ compress_pixels=(unsigned char *) AcquireQuantumMemory(length+
+ (length/127)+256,sizeof(*compress_pixels));
if (compress_pixels == (unsigned char *) NULL)
{
pixels=(unsigned char *) RelinquishMagickMemory(pixels);
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
- (void) memset(compress_pixels,0,(length+256)*
+ (void) memset(compress_pixels,0,(length+(length/127)+256)*
sizeof(*compress_pixels));
(void) FormatLocaleString(buffer,MagickPathExtent,"\033*b2M");
(void) WriteBlobString(image,buffer);