Chromium Code Reviews| Index: ui/events/ozone/evdev/touch_event_converter_evdev.cc |
| diff --git a/ui/events/ozone/evdev/touch_event_converter_evdev.cc b/ui/events/ozone/evdev/touch_event_converter_evdev.cc |
| index 3cca7ac012a268c59fbb9c2e20ccdf2c056c8967..c50a0bc4e1958ca14313887dceca4d17c6f55639 100644 |
| --- a/ui/events/ozone/evdev/touch_event_converter_evdev.cc |
| +++ b/ui/events/ozone/evdev/touch_event_converter_evdev.cc |
| @@ -170,8 +170,9 @@ void TouchEventConverterEvdev::ProcessInputEvent(const input_event& input) { |
| } else if(syn_dropped_) { |
| // Do nothing. This branch indicates we have lost sync with the driver. |
| } else if (input.type == EV_ABS) { |
| - if (current_slot_ >= MAX_FINGERS) { |
| - LOG(ERROR) << "too many touch events: " << current_slot_; |
| + if ((current_slot_ >= MAX_FINGERS || current_slot_ < 0) && |
| + input.code != ABS_MT_SLOT) { |
|
spang
2015/02/02 19:22:00
Can't we keep the range check inside "case ABS_MT_
|
| + LOG(ERROR) << "invalid touch event index: " << current_slot_; |
| return; |
| } |
| ProcessAbs(input); |
| @@ -223,13 +224,7 @@ void TouchEventConverterEvdev::ProcessAbs(const input_event& input) { |
| events_[current_slot_].pressure_ /= pressure_max_ - pressure_min_; |
| break; |
| case ABS_MT_SLOT: |
| - if (input.value >= MAX_FINGERS) { |
| - LOG(ERROR) << "multi-touch slot " << input.value |
| - << " exceeds MAX_FINGERS"; |
| - break; |
| - } |
| current_slot_ = input.value; |
| - altered_slots_.set(current_slot_); |
| break; |
| default: |
| DVLOG(5) << "unhandled code for EV_ABS: " << input.code; |