Commit 84a9dbf9d for imagemagick.org

commit 84a9dbf9ddc624e87990bf55f57eaf3d58694cbc
Author: Cristy <urban-warrior@imagemagick.org>
Date:   Wed Nov 4 11:29:37 2026 -0500

    https://github.com/ImageMagick/ImageMagick/issues/9093

diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 8c13db041..ccb0fe295 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -3030,17 +3030,17 @@ static MagickBooleanType RenderMVGContent(Image *image,
             (void) GetNextToken(q,&q,extent,token);
             if (graphic_context[n]->clip_path != MagickFalse)
               break;
-            mvg_class=(const char *) GetValueFromSplayTree(macros,token);
-            if (mvg_class != (const char *) NULL)
+            (void) FormatLocaleString(pattern,MagickPathExtent,"%s",token);
+            if (GetImageArtifact(image,pattern) != (const char *) NULL)
               {
-                (void) DrawPatternPath(image,draw_info,mvg_class,
+                (void) DrawPatternPath(image,draw_info,token,
                   &graphic_context[n]->fill_pattern,exception);
                 break;
               }
-            (void) FormatLocaleString(pattern,MagickPathExtent,"%s",token);
-            if (GetImageArtifact(image,pattern) != (const char *) NULL)
+            mvg_class=(const char *) GetValueFromSplayTree(macros,token);
+            if (mvg_class != (const char *) NULL)
               {
-                (void) DrawPatternPath(image,draw_info,token,
+                (void) DrawPatternPath(image,draw_info,mvg_class,
                   &graphic_context[n]->fill_pattern,exception);
                 break;
               }
@@ -3803,17 +3803,17 @@ static MagickBooleanType RenderMVGContent(Image *image,
             (void) GetNextToken(q,&q,extent,token);
             if (graphic_context[n]->clip_path != MagickFalse)
               break;
-            mvg_class=(const char *) GetValueFromSplayTree(macros,token);
-            if (mvg_class != (const char *) NULL)
+            (void) FormatLocaleString(pattern,MagickPathExtent,"%s",token);
+            if (GetImageArtifact(image,pattern) != (const char *) NULL)
               {
-                (void) DrawPatternPath(image,draw_info,mvg_class,
+                (void) DrawPatternPath(image,draw_info,token,
                   &graphic_context[n]->stroke_pattern,exception);
                 break;
               }
-            (void) FormatLocaleString(pattern,MagickPathExtent,"%s",token);
-            if (GetImageArtifact(image,pattern) != (const char *) NULL)
+            mvg_class=(const char *) GetValueFromSplayTree(macros,token);
+            if (mvg_class != (const char *) NULL)
               {
-                (void) DrawPatternPath(image,draw_info,token,
+                (void) DrawPatternPath(image,draw_info,mvg_class,
                   &graphic_context[n]->stroke_pattern,exception);
                 break;
               }