summaryrefslogtreecommitdiffstats
path: root/jni/feature_mos
diff options
context:
space:
mode:
authorWei-Ta Chen <weita@google.com>2011-08-30 12:42:31 -0700
committerWei-Ta Chen <weita@google.com>2011-08-30 12:50:17 -0700
commit50f36b9eaa0e177cf220737e322576437f051da3 (patch)
tree7c63ca82d0ab4027b110cd0e6126d57edf22252d /jni/feature_mos
parent82cb3ddd27747fa11baffa4cb7b1b9bc119f9ec9 (diff)
downloadLegacyCamera-50f36b9eaa0e177cf220737e322576437f051da3.zip
LegacyCamera-50f36b9eaa0e177cf220737e322576437f051da3.tar.gz
LegacyCamera-50f36b9eaa0e177cf220737e322576437f051da3.tar.bz2
Fix a monkey bug - a null pointer issue in native.
A monkey report shows that we try to generate a mosaic even before we added any frame to the aligner. This is unlikely to be triggered by human actions but machine generated sequences. To fix it, we ensure that we do blending on frames only after we have accepted frames in aligner. Bug: 5182097 Change-Id: I16c8efea2b1e3f5b53e65e480da169e24c939ec2
Diffstat (limited to 'jni/feature_mos')
-rw-r--r--jni/feature_mos/src/mosaic/Mosaic.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/jni/feature_mos/src/mosaic/Mosaic.cpp b/jni/feature_mos/src/mosaic/Mosaic.cpp
index 1b50c0c..988ec28 100644
--- a/jni/feature_mos/src/mosaic/Mosaic.cpp
+++ b/jni/feature_mos/src/mosaic/Mosaic.cpp
@@ -157,6 +157,14 @@ int Mosaic::createMosaic(float &progress)
{
printf("Creating mosaic\n");
+ if (frames_size <= 0)
+ {
+ // Haven't accepted any frame in aligner. No need to do blending.
+ progress = TIME_PERCENT_ALIGN + TIME_PERCENT_BLEND
+ + TIME_PERCENT_FINAL;
+ return MOSAIC_RET_OK;
+ }
+
if (blendingType == Blend::BLEND_TYPE_PAN)
{