From c1b78765729c878af2016c05e6a036e688191f95 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Thu, 2 Feb 2012 15:34:53 +0200 Subject: CameraHal: Avoid possible segfaults in 'setExtraData()' - There is a chance that the OMX component could get released while 'startImageCapture()' is still waiting for the shutter callback. In this case we should omit the extra data configuration. - Should fix bug: 5911295 Change-Id: I82344573e56d7b58f119f68905e2fa1eaa3d69fe Signed-off-by: Emilian Peev --- camera/OMXCameraAdapter/OMXCameraAdapter.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'camera') diff --git a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp index 3d07d5e4..eb4fa008 100755 --- a/camera/OMXCameraAdapter/OMXCameraAdapter.cpp +++ b/camera/OMXCameraAdapter/OMXCameraAdapter.cpp @@ -3404,7 +3404,8 @@ status_t OMXCameraAdapter::setExtraData(bool enable, OMX_U32 nPortIndex, OMX_EXT LOG_FUNCTION_NAME; - if (OMX_StateInvalid == mComponentState) { + if ( ( OMX_StateInvalid == mComponentState ) || + ( NULL == mCameraAdapterParameters.mHandleComp ) ) { CAMHAL_LOGEA("OMX component is in invalid state"); return -EINVAL; } -- cgit v1.2.3