From 90bdb5e2a6446da28d56ffd688978ebafcabfd42 Mon Sep 17 00:00:00 2001 From: Michael Votaw Date: Mon, 24 Mar 2025 16:39:09 -0500 Subject: [PATCH] Check that lines at least has one line, to prevent infinite loop --- src/Steps.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Steps.cpp b/src/Steps.cpp index 852b457ea6..799208a4e2 100644 --- a/src/Steps.cpp +++ b/src/Steps.cpp @@ -869,7 +869,7 @@ RString Steps::MinimizedChartString() bool minimal = false; std::vector lines; split(measures[m], "\n", lines, true); - while (!minimal && lines.size() % 2 == 0) + while (lines.size() > 0 && !minimal && lines.size() % 2 == 0) { // If every other line is all 0s, we can minimize the measure for (unsigned i = 1; i < lines.size(); i += 2)