From c0043c2bc1cc886a7644151662a050c497d00e3c Mon Sep 17 00:00:00 2001 From: kevingpqi123 Date: Mon, 29 May 2023 16:33:58 +0800 Subject: [PATCH] Fix the crash of CallObjectMethod. (#959) Co-authored-by: kevingpqi (cherry picked from commit 5cc6f6fbabb0556004316b2bd93d3a6f3d04b3d9) --- tgfx/src/platform/android/NativeCodec.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tgfx/src/platform/android/NativeCodec.cpp b/tgfx/src/platform/android/NativeCodec.cpp index 462ebdfec2..ec704e5eee 100644 --- a/tgfx/src/platform/android/NativeCodec.cpp +++ b/tgfx/src/platform/android/NativeCodec.cpp @@ -230,6 +230,9 @@ static jobject ConvertHardwareBitmap(JNIEnv* env, jobject bitmap) { // The AndroidBitmapInfo does not contain the ANDROID_BITMAP_FLAGS_IS_HARDWARE flag in the old // versions of Android NDK, even when the Java Bitmap has the hardware config. So we check it here // by the Java-side methods. + if (bitmap == nullptr) { + return nullptr; + } if (BitmapConfig_HARDWARE == nullptr) { return bitmap; }