aboutsummaryrefslogtreecommitdiffstats
path: root/videocodec/OMXVideoEncoderAVC.cpp
diff options
context:
space:
mode:
authorLiu Bolun <bolunx.liu@intel.com>2012-08-23 16:37:14 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:02:48 -0700
commit3b0173bed5cf2c4044399cd2466425c39c62e597 (patch)
treeaa3a640fed9adf7c79c91dde161d4bb783f7716d /videocodec/OMXVideoEncoderAVC.cpp
parent8332b6aabd6694874a3269850c6d6f62fd76896d (diff)
downloadandroid_hardware_intel_common_omx-components-3b0173bed5cf2c4044399cd2466425c39c62e597.tar.gz
android_hardware_intel_common_omx-components-3b0173bed5cf2c4044399cd2466425c39c62e597.tar.bz2
android_hardware_intel_common_omx-components-3b0173bed5cf2c4044399cd2466425c39c62e597.zip
[PORT FROM R3]Add null pointer protection before passing to encoder
BZ: 53189 Under rare circumstance, the pointer of video encodermight be null which will cause media server died. So, we need adding protection before using it. If it is null pointer, return OMX_ErrorBadParameterto omx client to avoid TOMBSTONE failure. Modifying for code style. Signed-off-by: Liu Bolun <bolunx.liu@intel.com> Change-Id: I276e93710ca36fdb06440812fb9be1fa98379c2d Reviewed-on: http://android.intel.com:8080/63258 Reviewed-by: Liu, BolunX <bolunx.liu@intel.com> Reviewed-by: Wang, Elaine <elaine.wang@intel.com> Reviewed-by: Shi, PingX <pingx.shi@intel.com> Tested-by: Shi, PingX <pingx.shi@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'videocodec/OMXVideoEncoderAVC.cpp')
-rw-r--r--videocodec/OMXVideoEncoderAVC.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/videocodec/OMXVideoEncoderAVC.cpp b/videocodec/OMXVideoEncoderAVC.cpp
index 25d6852..cce3ca5 100644
--- a/videocodec/OMXVideoEncoderAVC.cpp
+++ b/videocodec/OMXVideoEncoderAVC.cpp
@@ -208,6 +208,11 @@ OMX_ERRORTYPE OMXVideoEncoderAVC::ProcessorProcess(
buffers[INPORT_INDEX]->pBuffer + buffers[INPORT_INDEX]->nOffset,
buffers[INPORT_INDEX]->nTimeStamp);
+ if(inBuf.data == NULL) {
+ LOGE("The Input buf is NULL\n");
+ return OMX_ErrorBadParameter;
+ }
+
if(mFrameRetrieved) {
// encode and setConfig need to be thread safe
pthread_mutex_lock(&mSerializationLock);