Merge "When user presses the power key while playing a local video, the surfaceflinger will crash." am: 60aac74fbc

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1920360

Change-Id: I6f9fd73bf8dc31d5ef3f56aedf8b219c119e4763
diff --git a/services/surfaceflinger/BufferLayer.cpp b/services/surfaceflinger/BufferLayer.cpp
index 23779be..f2a6994 100644
--- a/services/surfaceflinger/BufferLayer.cpp
+++ b/services/surfaceflinger/BufferLayer.cpp
@@ -325,7 +325,7 @@
                 : Hwc2::IComposerClient::Composition::DEVICE;
     }
 
-    compositionState->buffer = mBufferInfo.mBuffer->getBuffer();
+    compositionState->buffer = getBuffer();
     compositionState->bufferSlot = (mBufferInfo.mBufferSlot == BufferQueue::INVALID_BUFFER_SLOT)
             ? 0
             : mBufferInfo.mBufferSlot;