diff options
-rw-r--r-- | src/com/android/camera/ui/ZoomView.java | 5 |
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; } |