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.17.96-1~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8ea800d36b1e64615f5830f5790239c4a5f90a0b;p=lilypond.git 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