summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqimengp <qimengp@codeaurora.org>2016-12-07 18:02:51 +0800
committerArne Coucheron <arco68@gmail.com>2017-06-13 07:16:28 +0200
commit975aecad9b4c62ce340db502fa9931cae106b82d (patch)
treec1ccc0b4ec5c129dfcfa35b1eccd32a4b1183810
parent922c4b3b80f07ba064aea58a98b0d5026c64e045 (diff)
downloadandroid_packages_apps_Snap-975aecad9b4c62ce340db502fa9931cae106b82d.zip
android_packages_apps_Snap-975aecad9b4c62ce340db502fa9931cae106b82d.tar.gz
android_packages_apps_Snap-975aecad9b4c62ce340db502fa9931cae106b82d.tar.bz2
SnapdragonCamera: Fix FC cause by Null pointer
When clearSight is failed, handleTimeout() is invoked to reset clearsight Engine, but ClearsightProcessHandler is still working and try to access null pointer object. By adding protect of null pointer can fix this issue. Change-Id: I4722721f3715077ec8303c4d14693ae4c1484420
-rwxr-xr-xsrc/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
index f1a082f..fd107e4 100755
--- a/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
+++ b/src/org/codeaurora/snapcam/filter/ClearSightImageProcessor.java
@@ -903,6 +903,12 @@ public class ClearSightImageProcessor {
mImageEncodeHandler.obtainMessage(MSG_START_CAPTURE).sendToTarget();
short encodeRequest = 0;
+ /* In same case, timeout will reset ClearSightNativeEngine object, so fields
+ in the object is not initial, need to return and skip process.
+ */
+ if (ClearSightNativeEngine.getInstance().getReferenceImage(true) == null) {
+ return;
+ }
long csTs = ClearSightNativeEngine.getInstance().getReferenceImage(true).getTimestamp();
CaptureRequest.Builder csRequest = createEncodeReprocRequest(
ClearSightNativeEngine.getInstance().getReferenceResult(true), CAM_TYPE_BAYER);