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

Commit 3407f728 authored by Jeykumar Sankaran's avatar Jeykumar Sankaran Committed by Steve Kondik
Browse files

surfaceflinger: Fix klockwork error.

Fix buffer overflow error while accessing format for display's
with indices more than MAX_HWC_DISPLAYS.

Change-Id: I5e5b69d8d043e900f5e33ca9a62e94ae5f857b68
parent 43116b05
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ sp<Fence> HWComposer::getDisplayFence(int disp) const {
}

uint32_t HWComposer::getFormat(int disp) const {
    if (uint32_t(disp)>31 || !mAllocatedDisplayIDs.hasBit(disp)) {
    if (uint32_t(disp)>= MAX_HWC_DISPLAYS || !mAllocatedDisplayIDs.hasBit(disp)) {
        return HAL_PIXEL_FORMAT_RGBA_8888;
    } else {
        return mDisplayData[disp].format;