summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorspang <spang@chromium.org>2015-07-30 06:48:20 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-30 13:49:27 +0000
commit925d5741f1cd7fcf6b99825ffc7dae0e36e95181 (patch)
tree1c5f3f4a25ff864769beea691ef2fa9d629b8457 /ash
parent16948129d41ec7291b128f5d358116d973c1e2f9 (diff)
downloadchromium_src-925d5741f1cd7fcf6b99825ffc7dae0e36e95181.zip
chromium_src-925d5741f1cd7fcf6b99825ffc7dae0e36e95181.tar.gz
chromium_src-925d5741f1cd7fcf6b99825ffc7dae0e36e95181.tar.bz2
ash: Don't crash associating touchscreens if there's no internal display
This fixes a null pointer dereference in AssociateTouchscreens() since 45f6aaf ("ash: Support multiple touch input devices per display"); BUG=515201 Review URL: https://codereview.chromium.org/1270453002 Cr-Commit-Position: refs/heads/master@{#341107}
Diffstat (limited to 'ash')
-rw-r--r--ash/touch/touchscreen_util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ash/touch/touchscreen_util.cc b/ash/touch/touchscreen_util.cc
index 8242c4b..fddf6e4 100644
--- a/ash/touch/touchscreen_util.cc
+++ b/ash/touch/touchscreen_util.cc
@@ -27,7 +27,8 @@ void AssociateTouchscreens(std::vector<DisplayInfo>* displays,
std::set<int> no_match_touchscreen;
for (size_t i = 0; i < devices.size(); ++i) {
- if (devices[i].type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
+ if (internal_state &&
+ devices[i].type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
VLOG(2) << "Found internal device for display " << internal_state->id()
<< " with device id " << devices[i].id << " size "
<< devices[i].size.ToString();