summaryrefslogtreecommitdiffstats
path: root/pdf
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2014-09-17 22:35:57 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-18 05:36:20 +0000
commit9b04ffd8e7a07e9b2947fe5b71acf85dff38a63f (patch)
tree73adc047aa459b89193bf210c02c12683018be29 /pdf
parent3558ad6e60006a99741e05f781ffb868ef1dcfc3 (diff)
downloadchromium_src-9b04ffd8e7a07e9b2947fe5b71acf85dff38a63f.zip
chromium_src-9b04ffd8e7a07e9b2947fe5b71acf85dff38a63f.tar.gz
chromium_src-9b04ffd8e7a07e9b2947fe5b71acf85dff38a63f.tar.bz2
Let PDFium handle event when there is not yet a visible page.
Speculative fix for 415307. CF will confirm. The stack trace for that bug indicates an attempt to index by -1, which is consistent with no visible page. BUG=415307 Review URL: https://codereview.chromium.org/560133004 Cr-Commit-Position: refs/heads/master@{#295421}
Diffstat (limited to 'pdf')
-rw-r--r--pdf/instance.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/pdf/instance.cc b/pdf/instance.cc
index bb13fcc..7706a69 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -520,6 +520,8 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) {
}
if (page_down) {
int page = engine_->GetFirstVisiblePage();
+ if (page == -1)
+ return true;
// Engine calculates visible page including delimiter to the page size.
// We need to check here if the page itself is completely out of view and
// scroll to the next one in that case.
@@ -531,6 +533,8 @@ bool Instance::HandleInputEvent(const pp::InputEvent& event) {
return true;
} else if (page_up) {
int page = engine_->GetFirstVisiblePage();
+ if (page == -1)
+ return true;
if (engine_->GetPageRect(page).y() * zoom_ >= v_scrollbar_->GetValue())
page--;
ScrollToPage(page);