From 6e8a95561988500b5b5ae4861b3b0cbf4fba517f Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 1 Apr 2021 09:47:56 -0400 Subject: [PATCH] Fix a number-up crash bug (Issue #413) --- CHANGES.md | 3 ++- htmldoc/ps-pdf.cxx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 224cbc30..f8443d4d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,8 @@ # Changes in HTMLDOC v1.9.12 - Fixed a crash bug with "data:" URIs and EPUB output (Issue #410) -- Fixed JPEG error handling (Issue #415) +- Fixed a number-up crash bug (Issue #413) +- Fixed JPEG error handling (Issue #414, Issue #415) - Fixed crash bugs with bogus table attributes (Issue #416, Issue #417) - Fixed a crash bug with malformed URIs (Issue #418) - Fixed a crash bug with malformed GIF files (Issue #423) diff --git a/htmldoc/ps-pdf.cxx b/htmldoc/ps-pdf.cxx index e963959b..ac95ba5a 100644 --- a/htmldoc/ps-pdf.cxx +++ b/htmldoc/ps-pdf.cxx @@ -1318,7 +1318,7 @@ pspdf_prepare_outpages() chapter_outstarts[c] = num_outpages; for (i = chapter_starts[c], j = 0, nup = -1, page = pages + i; - i <= chapter_ends[c]; + i <= chapter_ends[c] && num_outpages < num_pages; i ++, page ++) { if (nup != page->nup)