diff options
| -rw-r--r-- | msm8998/sdm/libs/hwc2/hwc_session.cpp | 14 |
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; } |
