Commit 907b74817 for imagemagick.org

commit 907b74817836b4f88e7453f0e95c849a1c5311aa
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Fri Aug 21 22:20:24 2026 +0200

    Don't throw a fatal exception when hitting a recursion depth (GHSA-27m9-54jx-fgvq).

diff --git a/MagickCore/xml-tree.c b/MagickCore/xml-tree.c
index 9468a82f4..fb1c6c4ec 100644
--- a/MagickCore/xml-tree.c
+++ b/MagickCore/xml-tree.c
@@ -531,8 +531,7 @@ static XMLTreeInfo *DestroyXMLTree_(XMLTreeInfo *xml_info,
   if (IsEventLogging() != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"...");
   if (depth > MagickMaxRecursionDepth)
-    ThrowFatalException(ResourceLimitFatalError,
-      "MemoryAllocationFailed");
+    return((XMLTreeInfo *) NULL);
   DestroyXMLTreeChild(xml_info,depth+1);
   DestroyXMLTreeOrdered(xml_info,depth+1);
   DestroyXMLTreeRoot(xml_info);