diff options
author | Natalie Silvanovich <natashenka@google.com> | 2015-02-19 00:05:53 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-19 00:05:53 +0000 |
commit | bb4d0676fde95e68fc708d54499bb40c8fa7ccd3 (patch) | |
tree | 8fd1f89a6614066da2eaf877fea8768d82e44637 /core | |
parent | 708959b5326b7877553397fc17237e02f0d3adb1 (diff) | |
parent | 494d5b7757fab576facc5a7e923d2a15650dea1c (diff) | |
download | frameworks_base-bb4d0676fde95e68fc708d54499bb40c8fa7ccd3.zip frameworks_base-bb4d0676fde95e68fc708d54499bb40c8fa7ccd3.tar.gz frameworks_base-bb4d0676fde95e68fc708d54499bb40c8fa7ccd3.tar.bz2 |
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
Diffstat (limited to 'core')
-rw-r--r-- | core/jni/android/graphics/Graphics.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp index d7b75db..41d1eb29 100644 --- a/core/jni/android/graphics/Graphics.cpp +++ b/core/jni/android/graphics/Graphics.cpp @@ -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); |