From 448ac0100b99da4d8fa446708481ce0093d945ac Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 25 Nov 2024 12:16:10 -0800 Subject: [PATCH] [android] remove fml_check from surface_texture_external_texture (flutter/engine#56760) We may fail to acquire a new image from the external image source. When this happens, don't crash the app. Fixes https://github.com/flutter/flutter/issues/159324 --- .../platform/android/surface_texture_external_texture.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/android/surface_texture_external_texture.cc b/engine/src/flutter/shell/platform/android/surface_texture_external_texture.cc index 383823585ce..ed019b9101a 100644 --- a/engine/src/flutter/shell/platform/android/surface_texture_external_texture.cc +++ b/engine/src/flutter/shell/platform/android/surface_texture_external_texture.cc @@ -52,7 +52,10 @@ void SurfaceTextureExternalTexture::Paint(PaintContext& context, if (should_process_frame) { ProcessFrame(context, bounds); } - FML_CHECK(state_ == AttachmentState::kAttached); + // If process frame failed, this may not be in attached state. + if (state_ != AttachmentState::kAttached) { + return; + } if (!dl_image_) { FML_LOG(WARNING)