From: Keith OHara Date: Sun, 24 Nov 2013 10:15:18 +0000 (+0100) Subject: Issue 1553: Staff stretching problem in 2.13.50+ X-Git-Tag: release/2.19.0-1~126 X-Git-Url: https://git.donarmstrong.com/?p=lilypond.git;a=commitdiff_plain;h=bb85b2f233e5adb92f29d1a0753d29663f24b13b Issue 1553: Staff stretching problem in 2.13.50+ optimal-page-breaking.cc needs to protect unsigned subtraction. Signed-off-by: David Kastrup --- 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