Commit 3d96d440 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Bound returned page by number of pages - 1

Closes: #404
Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent aaa54673
......@@ -81,7 +81,7 @@ position_to_page_number(zathura_document_t* document, double pos_x,
if (page < c0 - 1) {
return 0;
} else {
return page - (c0 - 1);
return MIN(page - (c0 - 1), npag - 1);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment