From 51aca8ead9129be9b5fa4fdfa866961e7bfcc219 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 3 Apr 2023 12:49:04 -0700 Subject: [PATCH] [Impeller] Don't crash in image decompression if the context is unavailable. (flutter/engine#40890) [Impeller] Don't crash in image decompression if the context is unavailable. --- engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc b/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc index 01ee5ce626..4d70397958 100644 --- a/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc +++ b/engine/src/flutter/lib/ui/painting/image_decoder_impeller.cc @@ -406,7 +406,10 @@ void ImageDecoderImpeller::Decode(fml::RefPtr descriptor, result, supports_wide_gamut = supports_wide_gamut_ // ]() { - FML_CHECK(context) << "No valid impeller context"; + if (!context) { + result(nullptr); + return; + } auto max_size_supported = context->GetResourceAllocator()->GetMaxTextureSizeSupported();