From bb85b2f233e5adb92f29d1a0753d29663f24b13b Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Sun, 24 Nov 2013 11:15:18 +0100 Subject: [PATCH] Issue 1553: Staff stretching problem in 2.13.50+ optimal-page-breaking.cc needs to protect unsigned subtraction. Signed-off-by: David Kastrup --- lily/optimal-page-breaking.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lily/optimal-page-breaking.cc b/lily/optimal-page-breaking.cc index 3bddcad4ba..3ff29d01bd 100644 --- a/lily/optimal-page-breaking.cc +++ b/lily/optimal-page-breaking.cc @@ -75,7 +75,9 @@ Optimal_page_breaking::solve () if (page_count > 1 && best.systems_per_page_[page_count - 2] > 1) min_sys_count -= best.systems_per_page_[page_count - 2]; - min_sys_count = max (min_sys_count, (vsize)1); + if (min_sys_count > ideal_sys_count // subtraction wrapped around + || min_sys_count <= 0) + min_sys_count = 1; } } else -- 2.39.5