From c5b23cbf2119540725e6dc81f4deb25798ead6a4 Mon Sep 17 00:00:00 2001
From: Cristy <urban-warrior@imagemagick.org>
Date: Mon, 6 Mar 2023 15:26:32 -0500
Subject: [PATCH] erecursion detection
CVE: CVE-2023-1289
Upstream-Status: Backport [https://github.com/ImageMagick/ImageMagick/commit/c5b23cbf2119540725e6dc81f4deb25798ead6a4]
Signed-off-by: Sana Kazi Sana.Kazi@kpit.com
---
 MagickCore/draw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/MagickCore/draw.c	2025-05-12 13:34:26.689655000 +0530
+++ b/MagickCore/draw.c	2025-05-12 13:45:30.136300211 +0530
@@ -5526,6 +5526,7 @@ MagickExport MagickBooleanType DrawPrimi
       if (primitive_info->text == (char *) NULL)
         break;
       clone_info=AcquireImageInfo();
+      clone_info->recursion_depth=draw_info->image_info->recursion_depth;      
       composite_images=(Image *) NULL;
       if (LocaleNCompare(primitive_info->text,"data:",5) == 0)
         composite_images=ReadInlineImage(clone_info,primitive_info->text,
