Commit 76aca775 authored by kylechar's avatar kylechar Committed by Commit bot

Check entry exists in DeviceDataManagerX11::UpdateDeviceList().

There is a crash in DeviceDataManagerX11::UpdateDeviceList() that could
occur if there is no valuator information for the deviceid.

BUG=716422

Review-Url: https://codereview.chromium.org/2856563002
Cr-Commit-Position: refs/heads/master@{#468340}
parent 3d7851ff
...@@ -680,6 +680,8 @@ bool DeviceDataManagerX11::GetDataRange(int deviceid, ...@@ -680,6 +680,8 @@ bool DeviceDataManagerX11::GetDataRange(int deviceid,
CHECK_GE(deviceid, 0); CHECK_GE(deviceid, 0);
if (deviceid >= kMaxDeviceNum) if (deviceid >= kMaxDeviceNum)
return false; return false;
if (valuator_lookup_[deviceid].empty())
return false;
if (valuator_lookup_[deviceid][type] >= 0) { if (valuator_lookup_[deviceid][type] >= 0) {
*min = valuator_min_[deviceid][type]; *min = valuator_min_[deviceid][type];
*max = valuator_max_[deviceid][type]; *max = valuator_max_[deviceid][type];
......
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