Use external texture for buffer release.
When the buffer needs to be released due to the producer id changing,
use the external texture and not the buffer in the transaction. This is
because the buffer might be null if the buffer was already cached.
Test: Not reproducible crash
Fixes: 271771720
Change-Id: I6453fd44811b076c0c5670c047fe108383f4f426
diff --git a/services/surfaceflinger/TransactionState.h b/services/surfaceflinger/TransactionState.h
index 6c5a8b2..40d06a8 100644
--- a/services/surfaceflinger/TransactionState.h
+++ b/services/surfaceflinger/TransactionState.h
@@ -85,7 +85,7 @@
for (auto state = states.begin(); state != states.end();) {
if (state->state.hasBufferChanges() && state->state.hasValidBuffer() &&
state->state.surface) {
- int result = visitor(state->state);
+ int result = visitor(state->state, state->externalTexture);
if (result == STOP_TRAVERSAL) return;
if (result == DELETE_AND_CONTINUE_TRAVERSAL) {
state = states.erase(state);