From d36358fc3b9fada3dcf120838d4e9aae725da89d Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Mon, 21 Jul 2025 17:57:36 +0200 Subject: [PATCH] chore: ensure dashes have a positive normalized length. prior checks of normalizedLength only ensure that at least one dash is valid. this ensures infinite loops cannot happen. --- src/shapes/paint/dash_path.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shapes/paint/dash_path.cpp b/src/shapes/paint/dash_path.cpp index ffe744464..5332bd970 100644 --- a/src/shapes/paint/dash_path.cpp +++ b/src/shapes/paint/dash_path.cpp @@ -71,6 +71,11 @@ ShapePaintPath* PathDasher::applyDash(const RawPath* source, { const Dash* dash = dashes[dashIndex++ % dashes.size()]; float dashLength = dash->normalizedLength(contour->length()); + if (dashLength <= 0.0f) + { + dashIndex++; + continue; + } if (dashLength > contour->length()) { dashLength = contour->length(); @@ -172,4 +177,4 @@ void DashPath::invalidateDash() stroke->parent()->addDirt(ComponentDirt::Paint); stroke->invalidateRendering(); } -} \ No newline at end of file +}