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

Commit d45fdc34 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

SurfaceComposerClient: Fix potential null de-reference in detachChildren

We return from the function when we know the pointer is null to
avoid dereferencing it.

Test: TreeHugger
Change-Id: I487b71ba185a48b505719a14b38b8a60283e10a7
parent b511836c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1051,6 +1051,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::detachCh
    layer_state_t* s = getLayerState(sc);
    if (!s) {
        mStatus = BAD_INDEX;
        return *this;
    }
    s->what |= layer_state_t::eDetachChildren;