From 50f36b9eaa0e177cf220737e322576437f051da3 Mon Sep 17 00:00:00 2001 From: Wei-Ta Chen Date: Tue, 30 Aug 2011 12:42:31 -0700 Subject: 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 --- jni/feature_mos/src/mosaic/Mosaic.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'jni') 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) { -- cgit v1.1