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
This commit is contained in:
John Reck
2015-06-16 10:29:31 -07:00
parent 6138a43ca9
commit 3f725f0a5a

View File

@@ -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);