Skip to content

Commit 4efc1bf

Browse files
HJessieRakeshBatra
authored andcommitted
Add null pointer check to avoid system crash.
Add null pointer check to avoid system crash. Meet the below crash log during some app operations then app exits. F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x78 F DEBUG : Cause: null pointer dereference F DEBUG : backtrace: F DEBUG : #00 pc 0000000000323858 /system/lib64/libhwui.so (android::uirenderer::DeferredLayerUpdater::apply()+40) F DEBUG : #1 pc 0000000000323040 /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13 DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c1671e 787f244890c877724752face20+416) Bug: b/243310920 Signed-off-by: Jessie Hao <[email protected]> Change-Id: I77226be2bd235852675bb4f7a29589e360269b33 Signed-off-by: Pranav Vashi <[email protected]> Signed-off-by: SuperDroidBond <[email protected]> Signed-off-by: RakeshBatra <[email protected]>
1 parent 6ba7873 commit 4efc1bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/hwui/renderthread/DrawFrameTask.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ bool DrawFrameTask::syncFrameState(TreeInfo& info) {
243243
mContext->unpinImages();
244244

245245
for (size_t i = 0; i < mLayers.size(); i++) {
246-
mLayers[i]->apply();
246+
if (mLayers[i]) {
247+
mLayers[i]->apply();
248+
}
247249
}
248250
mLayers.clear();
249251
mContext->setContentDrawBounds(mContentDrawBounds);

0 commit comments

Comments
 (0)