diff options
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index a512acc1c9..9173165d0c 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1289,9 +1289,14 @@ void Layer::pushPendingState() { // If this transaction is waiting on the receipt of a frame, generate a sync // point and send it to the remote layer. if (mCurrentState.handle != nullptr) { - sp<Handle> handle = static_cast<Handle*>(mCurrentState.handle.get()); - sp<Layer> handleLayer = handle->owner.promote(); - if (handleLayer == nullptr) { + sp<IBinder> strongBinder = mCurrentState.handle.promote(); + sp<Handle> handle = nullptr; + sp<Layer> handleLayer = nullptr; + if (strongBinder != nullptr) { + handle = static_cast<Handle*>(strongBinder.get()); + handleLayer = handle->owner.promote(); + } + if (strongBinder == nullptr || handleLayer == nullptr) { ALOGE("[%s] Unable to promote Layer handle", mName.string()); // If we can't promote the layer we are intended to wait on, // then it is expired or otherwise invalid. Allow this transaction |