OSDN Git Service
(root)
/
android-x86
/
frameworks-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
61333d1
)
Check that bitmap's size does not exceed 32 bits. DO NOT MERGE
author
Leon Scroggins III
<scroggo@google.com>
Mon, 9 Feb 2015 20:42:19 +0000
(15:42 -0500)
committer
Leon Scroggins
<scroggo@google.com>
Tue, 10 Feb 2015 20:57:45 +0000
(20:57 +0000)
BUG:
19270126
Change-Id: I075d1cefcd3208305a72b4fa629a262e92eb60ea
core/jni/android/graphics/Graphics.cpp
patch
|
blob
|
history
diff --git
a/core/jni/android/graphics/Graphics.cpp
b/core/jni/android/graphics/Graphics.cpp
index
a51af40
..
3ea9b58
100644
(file)
--- a/
core/jni/android/graphics/Graphics.cpp
+++ b/
core/jni/android/graphics/Graphics.cpp
@@
-536,7
+536,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);