Commit 7b4e16aa authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

Fix crash in PDF Viewer when clicking on link to an invalid page.

Bug: 821301
Change-Id: I573f5f90fa896f92f91ca63bfda2588469ab5aab
Reviewed-on: https://chromium-review.googlesource.com/960594Reviewed-by: default avatarTom Sepez <tsepez@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542864}
parent 09b9e2e2
...@@ -2030,6 +2030,9 @@ bool PDFiumEngine::OnMouseUp(const pp::MouseInputEvent& event) { ...@@ -2030,6 +2030,9 @@ bool PDFiumEngine::OnMouseUp(const pp::MouseInputEvent& event) {
return true; return true;
} }
if (area == PDFiumPage::DOCLINK_AREA) { if (area == PDFiumPage::DOCLINK_AREA) {
if (!PageIndexInBounds(target.page))
return true;
pp::Rect page_rect(GetPageScreenRect(target.page)); pp::Rect page_rect(GetPageScreenRect(target.page));
int y = position_.y() + page_rect.y(); int y = position_.y() + page_rect.y();
if (target.y_in_pixels) if (target.y_in_pixels)
......
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