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

Commit 3034d451 authored by Raph Levien's avatar Raph Levien Committed by Android (Google) Code Review
Browse files

Merge "Fix for native crash on image decode OOM" into jb-mr1-dev

parents 74defbf2 005bfc69
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -340,7 +340,9 @@ static jobject doDecode(JNIEnv* env, SkStream* stream, jobject padding,

        bitmap->setConfig(config, scaledWidth, scaledHeight);
        bitmap->setIsOpaque(decoded->isOpaque());
        bitmap->allocPixels(&javaAllocator, NULL);
        if (!bitmap->allocPixels(&javaAllocator, NULL)) {
            return nullObjectReturn("allocation failed for scaled bitmap");
        }
        bitmap->eraseColor(0);

        SkPaint paint;