Commit 68d1c9332 for imagemagick.org

commit 68d1c93320e8877e16060c83e2fcdf63aa4c5c16
Author: Dirk Lemstra <dirk@lemstra.org>
Date:   Mon Jun 15 22:20:12 2026 +0200

    Guard odd dash pattern duplication loop

diff --git a/MagickCore/draw.c b/MagickCore/draw.c
index 81f125373..964bced72 100644
--- a/MagickCore/draw.c
+++ b/MagickCore/draw.c
@@ -3847,7 +3847,7 @@ static MagickBooleanType RenderMVGContent(Image *image,
                   if (graphic_context[n]->dash_pattern[j] <= 0.0)
                     status=MagickFalse;
                 }
-                if ((x & 0x01) != 0)
+                if (((x & 0x01) != 0) && (j == x))
                   for ( ; j < (2*x); j++)
                     graphic_context[n]->dash_pattern[j]=
                       graphic_context[n]->dash_pattern[j-x];
diff --git a/MagickWand/drawing-wand.c b/MagickWand/drawing-wand.c
index e89a1cccc..6bf260c81 100644
--- a/MagickWand/drawing-wand.c
+++ b/MagickWand/drawing-wand.c
@@ -6463,7 +6463,7 @@ WandExport MagickBooleanType DrawSetVectorGraphics(DrawingWand *wand,
                 CurrentContext->dash_pattern[j]=StringToDouble(token,
                   (char **) NULL);
               }
-              if ((x & 0x01) != 0)
+              if (((x & 0x01) != 0) && (j == x))
                 for ( ; j < (2*x); j++)
                   CurrentContext->dash_pattern[j]=
                     CurrentContext->dash_pattern[j-x];