[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.
This commit is contained in:
Chinmay Garde
2023-04-03 12:49:04 -07:00
committed by GitHub
parent 874d36fdf7
commit 51aca8ead9

View File

@@ -406,7 +406,10 @@ void ImageDecoderImpeller::Decode(fml::RefPtr<ImageDescriptor> 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();