Fix Buffer Overflow in Vendor Service display.qservice

Fix for msm8996.

Bug: 63145942
Test: adb shell vndservice call display.qservice 36 s16 sdlkfjsadlfkjasdf
Change-Id: I6021876bf774ed63fbe71cea56a13f9bf6cceda9
This commit is contained in:
Courtney Goeltzenleuchter 2018-05-24 14:55:28 -06:00
parent 05b2a3cf90
commit e10b84c30c
1 changed files with 5 additions and 0 deletions

View File

@ -1215,6 +1215,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;