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

Commit d96534c4 authored by Melody Hsu's avatar Melody Hsu
Browse files

Add snapshot nullptr check in SF#renderScreenImpl

A layer that is not parented to the layer hierarchy could
have a null snapshot, in which case we can ignore it when
finding the display.

Fixes: b/331874495, b/331923495
Test: presubmit
Change-Id: I06ed68d2af4afd47fb83f8c38ba11b70fe6700f0
parent 06bf5557
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -8295,11 +8295,13 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
            const frontend::LayerSnapshot* snapshot = mLayerLifecycleManagerEnabled
                    ? mLayerSnapshotBuilder.getSnapshot(parent->sequence)
                    : parent->getLayerSnapshot();
            display = findDisplay([layerStack =
                                           snapshot->outputFilter.layerStack](const auto& display) {
            if (snapshot) {
                display = findDisplay([layerStack = snapshot->outputFilter.layerStack](
                                              const auto& display) {
                              return display.getLayerStack() == layerStack;
                          }).get();
            }
        }

        if (display == nullptr) {
            display = renderArea->getDisplayDevice().get();