Skip to content

Commit

Permalink
[74_2] fix crash when breaking page in large table (#1430)
Browse files Browse the repository at this point in the history
## Why you open this Pull Request?

Fixes 74_2

## What work have you done in the current Pull Request?

- [x] improve new page breaking algorithm to avoid segfault

Co-authored-by: Joris van der Hoeven <[email protected]>
  • Loading branch information
jingkaimori and vdhoeven authored Dec 9, 2023
1 parent fff93e3 commit 8f6a76c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Typeset/Page/new_breaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,18 @@ new_breaker_rep::find_page_breaks () {
}
if (best_start == path (N(l))) break;
find_page_breaks (best_start);
while (N(todo_list) == 0 && !best_prev->contains (N(l))) {
// Fix for bug #62844
path best (0);
for (iterator<path> it= iterate (best_prev); it->busy (); ) {
path next= it->next ();
if (path_inf (best, next))
if (!done_list->contains (next) ||
(temp_list->contains (next) && next != best_start))
best= next;
}
find_page_breaks (best);
}
}
}
//cout << "Found page breaks" << LF;
Expand Down

0 comments on commit 8f6a76c

Please sign in to comment.