summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/ZoomView.java
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-10-01 15:04:09 -0700
committerDoris Liu <tianliu@google.com>2013-10-01 15:51:39 -0700
commit1f69e36bc45ccf0090cb1d8392d603cfe2a4e8bf (patch)
treee281e8697b509dcd7a562a2a29fa53dbf50afda4 /src/com/android/camera/ui/ZoomView.java
parent7fc104e4e75ac881269fd4a093513da01565e5d6 (diff)
downloadandroid_packages_apps_Snap-1f69e36bc45ccf0090cb1d8392d603cfe2a4e8bf.tar.gz
android_packages_apps_Snap-1f69e36bc45ccf0090cb1d8392d603cfe2a4e8bf.tar.bz2
android_packages_apps_Snap-1f69e36bc45ccf0090cb1d8392d603cfe2a4e8bf.zip
A workaround for crash in zoom view
Bug: 10636636 Change-Id: Iffa126781fd71796b8816d637263450911cb7e8e
Diffstat (limited to 'src/com/android/camera/ui/ZoomView.java')
-rw-r--r--src/com/android/camera/ui/ZoomView.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/ZoomView.java b/src/com/android/camera/ui/ZoomView.java
index 65c4f2e4a..ca9747b0d 100644
--- a/src/com/android/camera/ui/ZoomView.java
+++ b/src/com/android/camera/ui/ZoomView.java
@@ -93,6 +93,11 @@ public class ZoomView extends ImageView {
// Make sure region to decode is inside the image.
region.intersect(0, 0, mFullResImageWidth - 1, mFullResImageHeight - 1);
+ if (region.width() == 0 || region.height() == 0) {
+ Log.e(TAG, "Invalid size for partial region. Region: " + region.toString());
+ return null;
+ }
+
if (isCancelled()) {
return null;
}