Skip to content

ev-print-operation.c: Reject page ranges outside the document - #734

Open
dualfroz wants to merge 1 commit into
linuxmint:masterfrom
dualfroz:fix/644-print-ranges-clamp
Open

dualfroz wants to merge 1 commit into
linuxmint:masterfrom
dualfroz:fix/644-print-ranges-clamp

Conversation

@dualfroz

Copy link
Copy Markdown

printing a page past the end (like page 11 of a 10 page pdf) crashed. clamp_ranges threw the range away but still returned TRUE with n_ranges set to 0, so the print loop went on reading export->ranges past its end. it now returns FALSE in that case, which shows the existing "Invalid page selection" warning, and dropped ranges no longer count towards n_pages_to_print. Fixes #644

clamp_ranges dropped ranges that start past the last page but still
returned TRUE when none were left, so printing went on with zero ranges
and read past the ranges array. It also counted the dropped ranges in
n_pages_to_print. Skip them in the count and treat an empty result as
an invalid selection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crashes if page number to be printed is higher than total number of pages

1 participant