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

Commit 3f725f0a authored by John Reck's avatar John Reck
Browse files

Fix null deref

Bug: 21857172

willHaveFunctor was assuming that either mStagingDisplayList
or mDisplayList would be non-null but this isn't true. Both
can be null in some scenarios (notably after a trimMemory)

Change-Id: Ia2915b84cfc907ec9c7cbec54ed6dc26283ec998
parent 6138a43c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -241,8 +241,12 @@ void RenderNode::prepareTreeImpl(TreeInfo& info, bool functorsNeedLayer) {
        animatorDirtyMask = mAnimatorManager.animate(info);
    }

    bool willHaveFunctor = info.mode == TreeInfo::MODE_FULL && mStagingDisplayListData
            ? !mStagingDisplayListData->functors.isEmpty() : !mDisplayListData->functors.isEmpty();
    bool willHaveFunctor = false;
    if (info.mode == TreeInfo::MODE_FULL && mStagingDisplayListData) {
        willHaveFunctor = !mStagingDisplayListData->functors.isEmpty();
    } else if (mDisplayListData) {
        willHaveFunctor = !mDisplayListData->functors.isEmpty();
    }
    bool childFunctorsNeedLayer = mProperties.prepareForFunctorPresence(
            willHaveFunctor, functorsNeedLayer);