ImmediateInterpreter: Fix use of touch_cnt as a finger count

In rare cases, HardwareState::touch_cnt may include fingers that aren't
actually tracked by the pad and thus may not be included in the
HardwareState::fingers array. Using it as the length for that array
could result in memory access issues.

BUG=None
TEST=unit tests

Change-Id: Ibb76063dbad7a58e14d3fc4729452a760ad04106
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4574665
Code-Coverage: Torsha Banerjee <torsha@google.com>
Tested-by: Harry Cutts <hcutts@chromium.org>
Reviewed-by: Sean O'Brien <seobrien@chromium.org>
Commit-Queue: Harry Cutts <hcutts@chromium.org>
1 file changed