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

Commit 06d5e359 authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

[libadapter] Fix nullpointer in acceptchanges

Check the layer still exists upon accepting changes.

Bug: 36205238
Test: AUPT
Change-Id: I8443265ecc7b8b0a12347439fd75b138d14c7e3a
parent 34ca5f2a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -538,6 +538,12 @@ Error HWC2On1Adapter::Display::acceptChanges() {
    for (auto& change : mChanges->getTypeChanges()) {
        auto layerId = change.first;
        auto type = change.second;
        if (mDevice.mLayers.count(layerId) == 0) {
            // This should never happen but somehow does.
            ALOGW("Cannot accept change for unknown layer (%" PRIu64 ")",
                  layerId);
            continue;
        }
        auto layer = mDevice.mLayers[layerId];
        layer->setCompositionType(type);
    }