aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuoliang Ji <guoliang.ji@intel.com>2012-09-29 09:48:07 +0800
committerPatrick Tjin <pattjin@google.com>2014-07-21 22:02:48 -0700
commit5392514b1aff96ce5eb13b28fe2099d54bbd59d1 (patch)
tree38f1860e444c02c75f1325a55840a3be978f82f1
parent9101b0d1ca310418db57a1a394f5990e717df647 (diff)
downloadandroid_hardware_intel_common_omx-components-5392514b1aff96ce5eb13b28fe2099d54bbd59d1.tar.gz
android_hardware_intel_common_omx-components-5392514b1aff96ce5eb13b28fe2099d54bbd59d1.tar.bz2
android_hardware_intel_common_omx-components-5392514b1aff96ce5eb13b28fe2099d54bbd59d1.zip
KW issue: the mBufferHandleMaps array request out of bound
BZ: 59929 Fix the issue by adding the error handling on the array index. Change-Id: I63aa259240720c57406b2c2374daf31a3f1babbb Signed-off-by: Guoliang Ji <guoliang.ji@intel.com> Reviewed-on: http://android.intel.com:8080/68433 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>
-rw-r--r--videocodec/OMXVideoEncoderBase.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/videocodec/OMXVideoEncoderBase.cpp b/videocodec/OMXVideoEncoderBase.cpp
index b45592f..0c812e1 100644
--- a/videocodec/OMXVideoEncoderBase.cpp
+++ b/videocodec/OMXVideoEncoderBase.cpp
@@ -875,6 +875,12 @@ int32_t OMXVideoEncoderBase::rgba2nv12conversion(OMX_BUFFERHEADERTYPE *pBuffer)
}
}
+ if(i >= sizeof(mBufferHandleMaps) / sizeof(mBufferHandleMaps[0]))
+ {
+ LOGE("mBufferHandleMaps array index out of bound\n");
+ return -1;
+ }
+
// Backup input buffer content
memcpy(mBufferHandleMaps[i].backBuffer, pBuffer->pBuffer,
pBuffer->nFilledLen);