Check that bitmap's size does not exceed 32 bits. DO NOT MERGE

BUG:19270126
Change-Id: I075d1cefcd3208305a72b4fa629a262e92eb60ea
(cherry picked from commit 89a2466a2a)
This commit is contained in:
Leon Scroggins III
2015-02-09 15:42:19 -05:00
committed by Leon Scroggins
parent 3162289445
commit b296e4e0c2

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