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

Commit b2fe3be4 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Fix crash when decoding bitmap

Externally reported crash when decoding corrupted .wmf file.
b/5048623

Change-Id: I1df0861cd36983cb4d1460caa221c54d3fc240af
parent 43b8fd76
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -360,6 +360,9 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,
        // already have a pixelref installed.
        // already have a pixelref installed.
        pr = bitmap->pixelRef();
        pr = bitmap->pixelRef();
    }
    }
    if (pr == NULL) {
        return nullObjectReturn("Got null SkPixelRef");
    }


    if (!isMutable) {
    if (!isMutable) {
        // promise we will never change our pixels (great for sharing and pictures)
        // promise we will never change our pixels (great for sharing and pictures)