summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jessie Hao <juan.hao@nxp.com> 2022-05-10 14:47:05 +0800
committer Jessie Hao <juan.hao@nxp.com> 2022-08-22 03:03:15 +0000
commit10f886750dcfbfc4e73cffa0c5191ea58aa30d8a (patch)
tree2f3462c75f9057a40ba103b76801a26f6d5b1cdc
parente648d3cb91f9a0156c729ca18ec27e71f59f9ce2 (diff)
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 : #01 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 <juan.hao@nxp.com> Change-Id: I77226be2bd235852675bb4f7a29589e360269b33
-rw-r--r--libs/hwui/renderthread/DrawFrameTask.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp
index 59c914f0198c..03f02de98efe 100644
--- a/libs/hwui/renderthread/DrawFrameTask.cpp
+++ b/libs/hwui/renderthread/DrawFrameTask.cpp
@@ -243,7 +243,9 @@ bool DrawFrameTask::syncFrameState(TreeInfo& info) {
mContext->unpinImages();
for (size_t i = 0; i < mLayers.size(); i++) {
- mLayers[i]->apply();
+ if (mLayers[i]) {
+ mLayers[i]->apply();
+ }
}
mLayers.clear();
mContext->setContentDrawBounds(mContentDrawBounds);