Merge "Fix NPE in BitmapFactory when an allocation of hw bitmap failed"
This commit is contained in:
committed by
Android (Google) Code Review
commit
0b513504e0
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user