summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d
diff options
context:
space:
mode:
authorWei Huang <weih@google.com>2011-09-02 11:40:00 -0700
committerWei Huang <weih@google.com>2011-09-02 11:40:00 -0700
commit9c12d7512df688131384328fb6ffb89b36cc4393 (patch)
tree6fec2f9ec659b03147d952bfe9a4a3321342e873 /src/com/android/gallery3d
parent28eb58218cfd50d07e8e333b4b7fd000037c6749 (diff)
downloadandroid_packages_apps_Snap-9c12d7512df688131384328fb6ffb89b36cc4393.tar.gz
android_packages_apps_Snap-9c12d7512df688131384328fb6ffb89b36cc4393.tar.bz2
android_packages_apps_Snap-9c12d7512df688131384328fb6ffb89b36cc4393.zip
bug #5252975: guard against null bitmap object, don't NPE.
- check for null Bitmap object before using. Change-Id: I99d85916dae45128d67be084860d66dd89ec2f95
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r--src/com/android/gallery3d/data/ImageCacheRequest.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/ImageCacheRequest.java b/src/com/android/gallery3d/data/ImageCacheRequest.java
index 104ff4839..0accd3f27 100644
--- a/src/com/android/gallery3d/data/ImageCacheRequest.java
+++ b/src/com/android/gallery3d/data/ImageCacheRequest.java
@@ -75,9 +75,16 @@ abstract class ImageCacheRequest implements Job<Bitmap> {
bitmap = BitmapUtils.resizeDownBySideLength(bitmap,
mTargetSize, true);
}
+ if (bitmap == null) {
+ return null;
+ }
if (jc.isCancelled()) return null;
byte[] array = BitmapUtils.compressBitmap(bitmap);
+ if (array == null) {
+ return null;
+ }
+
if (jc.isCancelled()) return null;
cacheService.putImageData(mPath, mType, array);