Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Add null pointer check to avoid system crash.
Browse files Browse the repository at this point in the history
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 <juan.hao@nxp.com>
Change-Id: I77226be2bd235852675bb4f7a29589e360269b33
  • Loading branch information
HJessie authored and thestinger committed May 1, 2023
1 parent b8f5ed5 commit c3ba98d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/hwui/renderthread/DrawFrameTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c3ba98d

Please sign in to comment.