]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 1553: Staff stretching problem in 2.13.50+
authorKeith OHara <k-ohara5a5a@oco.net>
Sun, 24 Nov 2013 10:15:18 +0000 (11:15 +0100)
committerDavid Kastrup <dak@gnu.org>
Sun, 24 Nov 2013 10:16:46 +0000 (11:16 +0100)
optimal-page-breaking.cc needs to protect unsigned subtraction.

Signed-off-by: David Kastrup <dak@gnu.org>
lily/optimal-page-breaking.cc

index 3bddcad4ba66815806fa1e691a2c2f229e1fc8f9..3ff29d01bd0d67d2bf8a644483dbbda3ef5d262a 100644 (file)
@@ -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