From 01cdf1ac7e78505f63eae27894fe709ea50c0c96 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Wed, 4 Jul 2007 11:47:40 +1000 Subject: [PATCH] Fix crash on page breaking --- lily/optimal-page-breaking.cc | 2 +- lily/page-breaking.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lily/optimal-page-breaking.cc b/lily/optimal-page-breaking.cc index 728e726a5e..34ff7f1b18 100644 --- a/lily/optimal-page-breaking.cc +++ b/lily/optimal-page-breaking.cc @@ -52,7 +52,7 @@ Optimal_page_breaking::solve () vsize ideal_sys_count = best.system_count (); vsize min_sys_count = ideal_sys_count - best.systems_per_page_.back (); - if (page_count > 1) + if (page_count > 1 && best.systems_per_page_[page_count - 2] > 1) min_sys_count -= best.systems_per_page_[page_count - 2]; if (page_count == 1) diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 2c137e3684..357eaabb78 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -759,6 +759,9 @@ Page_breaking::space_systems_on_best_pages (vsize configuration, vsize first_pag Page_spacing_result Page_breaking::finalize_spacing_result (vsize configuration, Page_spacing_result res) { + if (res.force_.empty ()) + return res; + cache_line_details (configuration); res.systems_per_page_ = uncompress_solution (res.systems_per_page_, cached_line_details_); -- 2.39.5