Commit 476854241 for imagemagick.org
commit 476854241a066041898cc0c9c91847460cde589b
Author: Cristy <urban-warrior@imagemagick.org>
Date: Thu Apr 9 10:49:25 2026 -0400
https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-2442-cq27-vf6x
diff --git a/coders/psd.c b/coders/psd.c
index d6e624244..4d179018b 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -2451,6 +2451,9 @@ static Image *ReadPSDImage(const ImageInfo *image_info,ExceptionInfo *exception)
if ((psd_info.version == 1) && ((psd_info.rows > 30000) ||
(psd_info.columns > 30000)))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
+ if ((psd_info.version == 2) && ((psd_info.rows > 300000) ||
+ (psd_info.columns > 300000)))
+ ThrowReaderException(CorruptImageError,"ImproperImageHeader");
psd_info.depth=ReadBlobMSBShort(image);
if ((psd_info.depth != 1) && (psd_info.depth != 8) &&
(psd_info.depth != 16) && (psd_info.depth != 32))