From 1243cc12c69ff7655c31ea333d10d5e22250bed3 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 23 Jun 2022 13:39:04 -0700 Subject: [PATCH] Add a null check to AndroidImageGenerator::GetPixels (flutter/engine#34149) --- .../flutter/shell/platform/android/android_image_generator.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/src/flutter/shell/platform/android/android_image_generator.cc b/engine/src/flutter/shell/platform/android/android_image_generator.cc index c53e36e3cb..d5255af97b 100644 --- a/engine/src/flutter/shell/platform/android/android_image_generator.cc +++ b/engine/src/flutter/shell/platform/android/android_image_generator.cc @@ -52,6 +52,10 @@ bool AndroidImageGenerator::GetPixels(const SkImageInfo& info, std::optional prior_frame) { fully_decoded_latch_.Wait(); + if (!software_decoded_data_) { + return false; + } + if (kRGBA_8888_SkColorType != info.colorType()) { return false; }