Commit 7d6cf46fa for imagemagick.org
commit 7d6cf46fa1bd15de3e1ff9800b64d3dcc9b2880b
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Thu Nov 12 22:31:39 2026 +0100
Don't allow a row width that could cause an overflow (GHSA-7pvc-jpr7-9wxq)
diff --git a/coders/exr.c b/coders/exr.c
index e880d341a..c2459f755 100644
--- a/coders/exr.c
+++ b/coders/exr.c
@@ -283,6 +283,9 @@ static MagickBooleanType InitializeEXRChannels(Image *image,
return(status);
if ((decoder.channel_count == 1) && (pixel_channels[0] == IndexPixelChannel))
image->colorspace=GRAYColorspace;
+ if ((*pixel_size == 0) || (columns > ((size_t) INT32_MAX/(*pixel_size))))
+ ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",
+ image->filename);
*data=(uint8_t *) AcquireQuantumMemory(*pixel_size,pixel_count);
if (*data == (uint8_t*)NULL)
ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed",