surfaceflinger: Access s3d flags only for valid display ID.

- Check if display id is within display ID range. Negative
  display ids lead to undefined behavior in CTS tests.

Change-Id: I2db8caf8d7ac65700e5bc37c180763357cc90aad
CRs-Fixed: 1043297
This commit is contained in:
Namit Solanki 2016-07-29 15:19:44 +05:30 committed by Steve Kondik
parent 3b418d69a3
commit a5f80a555a

View File

@ -82,6 +82,9 @@ uint32_t ExHWComposer::getS3DFlag(int disp) const {
return 0;
}
if (!mHwc || uint32_t(disp) >= MAX_HWC_DISPLAYS || !mAllocatedDisplayIDs.hasBit(disp))
return 0;
const DisplayData& disp_data(mDisplayData[disp]);
for (size_t i=0 ; i<disp_data.list->numHwLayers-1; i++) {