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

Commit c0935e2c authored by Devendra Singhi's avatar Devendra Singhi Committed by Ayushi Khopkar
Browse files

surfaceflinger_displayhardware_fuzzer: Bug Fix

Resolved Abort due to bad_optional_access

Test: ./surfaceflinger_displayhardware_fuzzer clusterfuzz-testcase-minimized-surfaceflinger_displayhardware_fuzzer-5652651762384896
Bug: 236301870

Change-Id: Ie31f2c2938ea722bde4f4d2ab28ab3ccb1f08d77
(cherry picked from commit c1da5d62e2bc4a1c3636cdda0a5176748f0512ee)
parent dcaf80d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -116,7 +116,8 @@ static constexpr hal::HWConfigId kActiveConfig = 0;
class DisplayHardwareFuzzer {
public:
    DisplayHardwareFuzzer(const uint8_t* data, size_t size) : mFdp(data, size) {
        mPhysicalDisplayId = SurfaceComposerClient::getInternalDisplayId().value();
        mPhysicalDisplayId = SurfaceComposerClient::getInternalDisplayId().value_or(
                PhysicalDisplayId::fromPort(mFdp.ConsumeIntegral<uint8_t>()));
    };
    void process();

+3 −1
Original line number Diff line number Diff line
@@ -534,7 +534,9 @@ public:
        ui::PixelFormat pixelFormat{};
        mFlinger->getHwComposer().allocateVirtualDisplay(halVirtualDisplayId, uiSize, &pixelFormat);

        PhysicalDisplayId physicalDisplayId = SurfaceComposerClient::getInternalDisplayId().value();
        PhysicalDisplayId physicalDisplayId =
                SurfaceComposerClient::getInternalDisplayId().value_or(
                        PhysicalDisplayId::fromPort(fdp->ConsumeIntegral<uint8_t>()));
        mFlinger->getHwComposer().allocatePhysicalDisplay(kHwDisplayId, physicalDisplayId);

        sp<IBinder> display =