From b38422a710c2516a033d1eac152e7d1880cd227a Mon Sep 17 00:00:00 2001 From: jfboeve Date: Thu, 11 Sep 2025 13:11:58 +0200 Subject: [PATCH] fix possible infinite loop when line is undefined --- src/core/text-rendering/sdf/Utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/text-rendering/sdf/Utils.ts b/src/core/text-rendering/sdf/Utils.ts index 86d48ec9..4e988242 100644 --- a/src/core/text-rendering/sdf/Utils.ts +++ b/src/core/text-rendering/sdf/Utils.ts @@ -36,13 +36,13 @@ export const measureLines = ( while (remainingLines > 0) { const line = lines[i]; + i++; + remainingLines--; if (line === undefined) { continue; } const width = measureText(line, fontFamily, designLetterSpacing); measuredLines.push([line, width]); - i++; - remainingLines--; } return [