From 1f69e36bc45ccf0090cb1d8392d603cfe2a4e8bf Mon Sep 17 00:00:00 2001 From: Doris Liu Date: Tue, 1 Oct 2013 15:04:09 -0700 Subject: [PATCH] A workaround for crash in zoom view Bug: 10636636 Change-Id: Iffa126781fd71796b8816d637263450911cb7e8e --- src/com/android/camera/ui/ZoomView.java | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.11.0