diff options
Diffstat (limited to 'services/java/com/android/server/KeyInputQueue.java')
-rw-r--r-- | services/java/com/android/server/KeyInputQueue.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/services/java/com/android/server/KeyInputQueue.java b/services/java/com/android/server/KeyInputQueue.java index 09591f44e5e3..5d65c714e77c 100644 --- a/services/java/com/android/server/KeyInputQueue.java +++ b/services/java/com/android/server/KeyInputQueue.java @@ -721,11 +721,14 @@ public abstract class KeyInputQueue { // virtual key area... but still // propagate this to the previous // data for comparisons. + int num = ms.mNextNumPointers; + if (num > InputDevice.MAX_POINTERS) { + num = InputDevice.MAX_POINTERS; + } System.arraycopy(ms.mNextData, 0, ms.mLastData, 0, - ms.mNextNumPointers - * MotionEvent.NUM_SAMPLE_DATA); - ms.mLastNumPointers = ms.mNextNumPointers; + num * MotionEvent.NUM_SAMPLE_DATA); + ms.mLastNumPointers = num; } ms.finish(); |