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

Commit 0b513504 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in BitmapFactory when an allocation of hw bitmap failed"

parents afcd59b4 d67bb1eb
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);
    }