diff options
author | Bobby Georgescu <georgescu@google.com> | 2013-04-01 13:48:29 -0700 |
---|---|---|
committer | Bobby Georgescu <georgescu@google.com> | 2013-04-01 14:38:05 -0700 |
commit | 12545f7a4a5e66fd59d6d6b2fdf907800e2df051 (patch) | |
tree | 6df681a8995678cad4df8e6ce6194d9baa33e15a /src/com/android/photos | |
parent | e5a79a5bd8ca3e25c14e4fe5df7c1ee1b544dc7e (diff) | |
download | android_packages_apps_Snap-12545f7a4a5e66fd59d6d6b2fdf907800e2df051.tar.gz android_packages_apps_Snap-12545f7a4a5e66fd59d6d6b2fdf907800e2df051.tar.bz2 android_packages_apps_Snap-12545f7a4a5e66fd59d6d6b2fdf907800e2df051.zip |
Enforce bmp type in pool, handle MTP image decode failure
- GalleryBitmapPool didn't reject bitmap types other than
ARGB_8888 which could lead to problems when a different type
is used for recycling.
- BitmapFactory throws an exception rather than returning null
when image decoding fails and an existing bitmap was supplied
for recycling, even if the failure was not caused by the use
of that bitmap. When decoding things from an MTP device, we
need to handle this since unsupported formats may be returned.
Change-Id: I8cc8aa46f5a741b360e806814991f74a131e9039
Diffstat (limited to 'src/com/android/photos')
-rw-r--r-- | src/com/android/photos/data/GalleryBitmapPool.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/photos/data/GalleryBitmapPool.java b/src/com/android/photos/data/GalleryBitmapPool.java index 4c3279f73..a5a17ede2 100644 --- a/src/com/android/photos/data/GalleryBitmapPool.java +++ b/src/com/android/photos/data/GalleryBitmapPool.java @@ -106,7 +106,7 @@ public class GalleryBitmapPool { } public boolean put(Bitmap b) { - if (b == null) { + if (b == null || b.getConfig() != Bitmap.Config.ARGB_8888) { return false; } SparseArrayBitmapPool pool = getPoolForDimensions(b.getWidth(), b.getHeight()); |