summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2020-01-15 15:57:12 -0800
committerXin Li <delphij@google.com>2020-01-15 15:57:12 -0800
commitd233954c5376ef7016859efbcf2bda1ab7d51531 (patch)
tree11ea4a4ce3340537295690a555debcf965d30dd3
parent134394962fc46d68fc8f295aed23c932a59c67a4 (diff)
parentd71ab162eaa2958a3d9ee7da81d7749340b3e45c (diff)
downloadplatform_hardware_qcom_display-android10-sidebranch.tar.gz
platform_hardware_qcom_display-android10-sidebranch.tar.bz2
platform_hardware_qcom_display-android10-sidebranch.zip
DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-masterandroid10-sidebranch
Bug: 146167222 Change-Id: Ibcca5a2f2d159b9f2fb18996f6b85733768f5733
-rw-r--r--msm8998/sdm/libs/hwc2/hwc_session.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/msm8998/sdm/libs/hwc2/hwc_session.cpp b/msm8998/sdm/libs/hwc2/hwc_session.cpp
index 0a8576ce..f0776678 100644
--- a/msm8998/sdm/libs/hwc2/hwc_session.cpp
+++ b/msm8998/sdm/libs/hwc2/hwc_session.cpp
@@ -992,7 +992,7 @@ android::status_t HWCSession::HandleSetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}
@@ -1011,7 +1011,7 @@ android::status_t HWCSession::HandleGetActiveDisplayConfig(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}
@@ -1031,7 +1031,7 @@ android::status_t HWCSession::HandleGetDisplayConfigCount(const android::Parcel
int dpy = input_parcel->readInt32();
int error = android::BAD_VALUE;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
return android::BAD_VALUE;
}
@@ -1055,7 +1055,7 @@ android::status_t HWCSession::HandleGetDisplayAttributesForConfig(const android:
int error = android::BAD_VALUE;
DisplayConfigVariableInfo display_attributes;
- if (dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy >= HWC_NUM_DISPLAY_TYPES || config < 0) {
return android::BAD_VALUE;
}
@@ -1251,7 +1251,7 @@ android::status_t HWCSession::SetColorModeOverride(const android::Parcel *input_
auto mode = static_cast<android_color_mode_t>(input_parcel->readInt32());
auto device = static_cast<hwc2_device_t *>(this);
- if (display > HWC_DISPLAY_VIRTUAL) {
+ if (display >= HWC_NUM_DISPLAY_TYPES) {
return -EINVAL;
}
@@ -1266,7 +1266,7 @@ android::status_t HWCSession::SetColorModeById(const android::Parcel *input_parc
auto mode = input_parcel->readInt32();
auto device = static_cast<hwc2_device_t *>(this);
- if (display > HWC_DISPLAY_VIRTUAL) {
+ if (display >= HWC_NUM_DISPLAY_TYPES) {
return -EINVAL;
}
@@ -1621,7 +1621,7 @@ android::status_t HWCSession::GetVisibleDisplayRect(const android::Parcel *input
SCOPE_LOCK(locker_);
int dpy = input_parcel->readInt32();
- if (dpy < HWC_DISPLAY_PRIMARY || dpy > HWC_DISPLAY_VIRTUAL) {
+ if (dpy < HWC_DISPLAY_PRIMARY || dpy >= HWC_NUM_DISPLAY_TYPES) {
return android::BAD_VALUE;
}