Commit 9bd0fea79 for imagemagick.org
commit 9bd0fea7958d6228b9d0fb450119b1462d14bb6b
Author: Cristy <urban-warrior@imagemagick.org>
Date: Tue Sep 22 07:47:30 2026 -0400
check for vector recursion
diff --git a/MagickCore/constitute-private.h b/MagickCore/constitute-private.h
index 36df9fc6a..f81b9d604 100644
--- a/MagickCore/constitute-private.h
+++ b/MagickCore/constitute-private.h
@@ -35,6 +35,12 @@ static inline Image *StrictReadImage(const ImageInfo *image_info,
char
magic[MagickPathExtent];
+ if (((ImageInfo *) image_info)->coder_depth++ > MagickMaxRecursionDepth)
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ OptionError,"ImageNestedTooDeeply","`%s'",image_info->filename);
+ return((Image *) NULL);
+ }
(void) GetPathComponent(image_info->filename,MagickPath,magic);
if (*magic != '\0')
{