Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5f80a55 authored by Namit Solanki's avatar Namit Solanki Committed by Steve Kondik
Browse files

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
parent 3b418d69
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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++) {