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

Commit 8bd8d896 authored by Jeff Brown's avatar Jeff Brown Committed by Android (Google) Code Review
Browse files

Merge "Fix possible leak in bitmap decoding." into jb-dev

parents 995cb973 27d83834
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -317,8 +317,6 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
            env->SetObjectField(javaBitmap, gBitmap_layoutBoundsFieldID, layoutBounds);
        }
    }
    // detach bitmap from its autodeleter, since we want to own it now
    adb.detach();

    if (willScale) {
        // This is weird so let me explain: we could use the scale parameter
@@ -369,6 +367,9 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
        pr->setImmutable();
    }

    // detach bitmap from its autodeleter, since we want to own it now
    adb.detach();

    if (javaBitmap != NULL) {
        // If a java bitmap was passed in for reuse, pass it back
        return javaBitmap;