summaryrefslogtreecommitdiffstats
path: root/graphics/java/android
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2013-11-06 14:01:28 -0800
committerChris Craik <ccraik@google.com>2013-11-06 14:01:28 -0800
commit222f2ad294c9046b62af5e059f8b409aec044ce9 (patch)
tree83c65f8b1f0572295a6a3823294631258f86f719 /graphics/java/android
parent194271565399a9216b8e0dece118874fc5f7e474 (diff)
downloadframeworks_base-222f2ad294c9046b62af5e059f8b409aec044ce9.zip
frameworks_base-222f2ad294c9046b62af5e059f8b409aec044ce9.tar.gz
frameworks_base-222f2ad294c9046b62af5e059f8b409aec044ce9.tar.bz2
Fix NPE with inPurgeable Bitmaps in getAllocationByteCount
bug:11556330 Change-Id: I430136ea15baeb60adfb9bb2acdde9505ce707fe
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/Bitmap.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 4c7395c..8c38d25 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -1167,6 +1167,11 @@ public final class Bitmap implements Parcelable {
* @see #reconfigure(int, int, Config)
*/
public final int getAllocationByteCount() {
+ if (mBuffer == null) {
+ // native backed bitmaps don't support reconfiguration,
+ // so alloc size is always content size
+ return getByteCount();
+ }
return mBuffer.length;
}