From 2ebfacc7fc6c76ea4db6ef96d29f9188177fe106 Mon Sep 17 00:00:00 2001 From: Tyler Luu Date: Mon, 12 Dec 2011 15:05:32 -0600 Subject: CameraHal: Add missing null check in OMX3A Check for null before strcmp b/5639860 Change-Id: I552213c9894679eeb64cd06419f3f430276b273e Signed-off-by: Tyler Luu --- camera/OMXCameraAdapter/OMX3A.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'camera') diff --git a/camera/OMXCameraAdapter/OMX3A.cpp b/camera/OMXCameraAdapter/OMX3A.cpp index ef02e49..5eadc44 100644 --- a/camera/OMXCameraAdapter/OMX3A.cpp +++ b/camera/OMXCameraAdapter/OMX3A.cpp @@ -273,7 +273,7 @@ status_t OMXCameraAdapter::setParameters3A(const CameraParameters ¶ms, OMX_BOOL lock = OMX_FALSE; mUserSetExpLock = OMX_FALSE; str = params.get(CameraParameters::KEY_AUTO_EXPOSURE_LOCK); - if ( (strcmp(str, "true")) == 0) + if (str && ((strcmp(str, "true")) == 0)) { CAMHAL_LOGVA("Locking Exposure"); lock = OMX_TRUE; @@ -298,7 +298,7 @@ status_t OMXCameraAdapter::setParameters3A(const CameraParameters ¶ms, OMX_BOOL lock = OMX_FALSE; mUserSetWbLock = OMX_FALSE; str = params.get(CameraParameters::KEY_AUTO_WHITEBALANCE_LOCK); - if ( (strcmp(str, "true")) == 0) + if (str && ((strcmp(str, "true")) == 0)) { CAMHAL_LOGVA("Locking WhiteBalance"); lock = OMX_TRUE; -- cgit v1.1