Fix Buffer Overflow in Vendor Service display.qservice

Bug: 63145942
Test: adb shell vndservice call display.qservice 36 s16 sdlkfjsadlfkjasdf
Change-Id: I3fdf5ccd2bf4ed0fa980883fefdb57eb5fbfeee7
(cherry picked from commit 4050091844)
This commit is contained in:
Courtney Goeltzenleuchter 2018-05-24 08:23:55 -06:00 committed by android-build-team Robot
parent 4fb1ecd923
commit d1c08b13d3
2 changed files with 10 additions and 0 deletions

View File

@ -1221,6 +1221,11 @@ android::status_t HWCSession::SetColorModeOverride(const android::Parcel *input_
auto display = static_cast<hwc2_display_t >(input_parcel->readInt32());
auto mode = static_cast<android_color_mode_t>(input_parcel->readInt32());
auto device = static_cast<hwc2_device_t *>(this);
if (display > HWC_DISPLAY_VIRTUAL) {
return -EINVAL;
}
auto err = CallDisplayFunction(device, display, &HWCDisplay::SetColorMode, mode);
if (err != HWC2_ERROR_NONE)
return -EINVAL;

View File

@ -1250,6 +1250,11 @@ android::status_t HWCSession::SetColorModeOverride(const android::Parcel *input_
auto display = static_cast<hwc2_display_t >(input_parcel->readInt32());
auto mode = static_cast<android_color_mode_t>(input_parcel->readInt32());
auto device = static_cast<hwc2_device_t *>(this);
if (display > HWC_DISPLAY_VIRTUAL) {
return -EINVAL;
}
auto err = CallDisplayFunction(device, display, &HWCDisplay::SetColorMode, mode);
if (err != HWC2_ERROR_NONE)
return -EINVAL;