summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorFlanker <i@flanker017.me>2015-10-22 22:28:01 +0000
committerandroid-build-merger <android-build-merger@google.com>2015-10-22 22:28:01 +0000
commita82ace99f76ed815e16ab64eae2e9e55871a8b8f (patch)
tree84452b1e89976357675daf0e9e1582a932fddbca /libs
parent8121177b5e8c406570f0eaf6593c6fd1db232ddf (diff)
parent9830f11dc6b6aa4001c79147966fdb9eaa71c2f2 (diff)
downloadframeworks_native-a82ace99f76ed815e16ab64eae2e9e55871a8b8f.zip
frameworks_native-a82ace99f76ed815e16ab64eae2e9e55871a8b8f.tar.gz
frameworks_native-a82ace99f76ed815e16ab64eae2e9e55871a8b8f.tar.bz2
add number constraint for samples per MotionEvent am: 5d17838ade am: 72c8ca4a01 am: 9964d83869 am: 90dc6dc825
am: 9830f11dc6 * commit '9830f11dc6b6aa4001c79147966fdb9eaa71c2f2': add number constraint for samples per MotionEvent
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 2c1418e..b64cb2c 100644
--- a/libs/input/Input.cpp
+++ b/libs/input/Input.cpp
@@ -424,7 +424,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;
}