Commit a96763d71 for imagemagick.org
commit a96763d717e27d6d136aa734d1cf4b33a91555d0
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Tue May 5 22:31:57 2026 +0200
Added missing check for the list length limit in the PSD decoder (GHSA-cwpj-h54c-xjpx)
diff --git a/coders/psd.c b/coders/psd.c
index 8de0501f4..2a09ae98e 100644
--- a/coders/psd.c
+++ b/coders/psd.c
@@ -1967,6 +1967,10 @@ static MagickBooleanType ReadPSDLayersInternal(Image *image,
image->alpha_trait=BlendPixelTrait;
}
+ if (AcquireMagickResource(ListLengthResource,number_layers) == MagickFalse)
+ ThrowBinaryException(ResourceLimitError,"ListLengthExceedsLimit",
+ image->filename);
+
/*
We only need to know if the image has an alpha channel
*/