summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 0b2880c37..06e9710f4 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -864,9 +864,14 @@ public class WideAnglePanoramaModule
perct = mActivity.getResources().getInteger(R.integer.panorama_frame_size_reduction);
}
- mMosaicFrameProcessor.initialize(mCameraPreviewWidth * perct / 100,
- mCameraPreviewHeight * perct / 100, getPreviewBufSize());
- mMosaicFrameProcessorInitialized = true;
+ int width = (mCameraPreviewWidth * perct) / 100;
+ int height = (mCameraPreviewHeight * perct) / 100;
+ if ((0 < width) && (0 < height)) {
+ mMosaicFrameProcessor.initialize(width, height, getPreviewBufSize());
+ mMosaicFrameProcessorInitialized = true;
+ } else {
+ throw new RuntimeException("Invalid preview dimension");
+ }
}
@Override