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:
1942715
)
Fix NPE with inPurgeable Bitmaps in getAllocationByteCount
author
Chris Craik
<ccraik@google.com>
Wed, 6 Nov 2013 22:01:28 +0000
(14:01 -0800)
committer
Chris Craik
<ccraik@google.com>
Wed, 6 Nov 2013 22:01:28 +0000
(14:01 -0800)
bug:
11556330
Change-Id: I430136ea15baeb60adfb9bb2acdde9505ce707fe
graphics/java/android/graphics/Bitmap.java
patch
|
blob
|
history
diff --git
a/graphics/java/android/graphics/Bitmap.java
b/graphics/java/android/graphics/Bitmap.java
index
4c7395c
..
8c38d25
100644
(file)
--- 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;
}