summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/input/Input.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/input/Input.cpp b/libs/input/Input.cpp
index d9f22e9..71b25b7 100644
--- a/libs/input/Input.cpp
+++ b/libs/input/Input.cpp
@@ -490,7 +490,8 @@ void MotionEvent::transform(const float matrix[9]) {
status_t MotionEvent::readFromParcel(Parcel* parcel) {
size_t pointerCount = parcel->readInt32();
size_t sampleCount = parcel->readInt32();
- if (pointerCount == 0 || pointerCount > MAX_POINTERS || sampleCount == 0) {
+ if (pointerCount == 0 || pointerCount > MAX_POINTERS ||
+ sampleCount == 0 || sampleCount > MAX_SAMPLES) {
return BAD_VALUE;
}