summaryrefslogtreecommitdiffstats
path: root/src
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 /src
parent922c4b3b80f07ba064aea58a98b0d5026c64e045 (diff)
downloadandroid_packages_apps_Snap-975aecad9b4c62ce340db502fa9931cae106b82d.tar.gz
android_packages_apps_Snap-975aecad9b4c62ce340db502fa9931cae106b82d.tar.bz2
android_packages_apps_Snap-975aecad9b4c62ce340db502fa9931cae106b82d.zip
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
Diffstat (limited to 'src')
-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 f1a082f75..fd107e446 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);