Skip to content

Commit

Permalink
Don't allow nan values in toc nodes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrdl-github committed Oct 12, 2023
1 parent 2cdf61c commit 2e3798e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pdf_viewer/document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,8 @@ void Document::convert_toc_tree(fz_outline* root, std::vector<TocNode*>& output)

TocNode* current_node = new TocNode;
current_node->title = utf8_decode(root->title);
current_node->x = root->x;
current_node->y = root->y;
current_node->x = std::isnan(root->x) ? 0.0 : root->x;
current_node->y = std::isnan(root->y) ? 0.0 : root->y;
if (root->page.page == -1) {
float xp, yp;
fz_location loc = fz_resolve_link(context, doc, root->uri, &xp, &yp);
Expand Down

0 comments on commit 2e3798e

Please sign in to comment.