Commit df50432c authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

PDF: Prevent a NOTREACHED() in HandleUpdateScrollMessage().

In OutOfProcessInstance::HandleUpdateScrollMessage(), the messages
received from JS sometimes contain integers and sometimes contain
doubles. As such, check validate them with is_number() rather than
is_int().

Bug: 1136983
Change-Id: Id3112e660a96d596b9da92c453caa5f697e5a5f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466514Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816405}
parent 4eb36bdc
...@@ -1852,8 +1852,8 @@ void OutOfProcessInstance::HandleSetTwoUpViewMessage( ...@@ -1852,8 +1852,8 @@ void OutOfProcessInstance::HandleSetTwoUpViewMessage(
void OutOfProcessInstance::HandleUpdateScrollMessage( void OutOfProcessInstance::HandleUpdateScrollMessage(
const pp::VarDictionary& dict) { const pp::VarDictionary& dict) {
if (!base::FeatureList::IsEnabled(features::kPDFViewerUpdate) || if (!base::FeatureList::IsEnabled(features::kPDFViewerUpdate) ||
!dict.Get(pp::Var(kJSUpdateScrollX)).is_int() || !dict.Get(pp::Var(kJSUpdateScrollX)).is_number() ||
!dict.Get(pp::Var(kJSUpdateScrollY)).is_int()) { !dict.Get(pp::Var(kJSUpdateScrollY)).is_number()) {
NOTREACHED(); NOTREACHED();
return; return;
} }
......
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