diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2015-03-17 17:53:10 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-03-17 17:53:10 -0700 |
commit | 468a14f255f6a515ba9afe2957c7ffb92fa41a0c (patch) | |
tree | 7765dbfc56082aafa100589163de7da817b2ad75 /src | |
parent | dc787d1a500220ff76b6ca1c95fd666ec13b4198 (diff) | |
parent | 02120bf815f1da3b1abac8d5e22127e414743b2c (diff) | |
download | android_packages_apps_Snap-468a14f255f6a515ba9afe2957c7ffb92fa41a0c.tar.gz android_packages_apps_Snap-468a14f255f6a515ba9afe2957c7ffb92fa41a0c.tar.bz2 android_packages_apps_Snap-468a14f255f6a515ba9afe2957c7ffb92fa41a0c.zip |
Merge "Snapdragon Camera: Check mosaic preview dimensions"
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaModule.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java index f7432bfb0..e7025a1a7 100644 --- a/src/com/android/camera/WideAnglePanoramaModule.java +++ b/src/com/android/camera/WideAnglePanoramaModule.java @@ -850,9 +850,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 |