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

This commit is contained in:
Raph Levien
2012-09-20 23:25:26 -07:00
committed by Android (Google) Code Review

View File

@@ -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;