am 494d5b77: Merge "Check that bitmap\'s size does not exceed 32 bits. DO NOT MERGE" into lmp-dev

* commit '494d5b7757fab576facc5a7e923d2a15650dea1c':
  Check that bitmap's size does not exceed 32 bits. DO NOT MERGE
This commit is contained in:
Natalie Silvanovich
2015-02-19 00:05:53 +00:00
committed by Android Git Automerger

View File

@@ -610,7 +610,12 @@ jbyteArray GraphicsJNI::allocateJavaPixelRef(JNIEnv* env, SkBitmap* bitmap,
return NULL;
}
const size_t size = bitmap->getSize();
const int64_t size64 = bitmap->computeSize64();
if (!sk_64_isS32(size64)) {
doThrowIAE(env, "bitmap size exceeds 32 bits");
return NULL;
}
const size_t size = sk_64_asS32(size64);
jbyteArray arrayObj = (jbyteArray) env->CallObjectMethod(gVMRuntime,
gVMRuntime_newNonMovableArray,
gByte_class, size);