Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d67bb1eb authored by sergeyv's avatar sergeyv Committed by Sergey Vasilinets
Browse files

Fix NPE in BitmapFactory when an allocation of hw bitmap failed

Test: no tests.
bug: 63044157
Change-Id: I33663c14983f2d0050521c9fea5742ae71f96c5f
parent 87cff854
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -579,6 +579,9 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding

    if (isHardware) {
        sk_sp<Bitmap> hardwareBitmap = Bitmap::allocateHardwareBitmap(outputBitmap);
        if (!hardwareBitmap.get()) {
            return nullObjectReturn("Failed to allocate a hardware bitmap");
        }
        return bitmap::createBitmap(env, hardwareBitmap.release(), bitmapCreateFlags,
                ninePatchChunk, ninePatchInsets, -1);
    }