diff options
| author | Ryan Saffores <ryan.d.saffores@intel.com> | 2013-12-10 10:08:59 -0800 |
|---|---|---|
| committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:02:56 -0700 |
| commit | 268c828093e7793f088a89d1151b0879b1acb00a (patch) | |
| tree | d7d40695836a805e159c3ff33d7750b4407b2453 /videocodec/securevideo | |
| parent | 7dd377db8d048cae4ddd459f97fd24643d7defe8 (diff) | |
| download | android_hardware_intel_common_omx-components-268c828093e7793f088a89d1151b0879b1acb00a.tar.gz android_hardware_intel_common_omx-components-268c828093e7793f088a89d1151b0879b1acb00a.tar.bz2 android_hardware_intel_common_omx-components-268c828093e7793f088a89d1151b0879b1acb00a.zip | |
Remove check of unused size variable in memory allocation
BZ: 157703
Removing the check and return on failure of the size variable
for secure memory allocation. For secure playback INPORT_BUFFER_SIZE
is used instead and the requested size is ignored so no need to check
if the size requested is > INPORT_BUFFER_SIZE.
Change-Id: Ic98eff2941ef07a9dbd041df839d43b53f67fc42
Signed-off-by: Ryan Saffores <ryan.d.saffores@intel.com>
Diffstat (limited to 'videocodec/securevideo')
5 files changed, 8 insertions, 25 deletions
diff --git a/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp b/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp index 3b980ed..453a680 100644 --- a/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp +++ b/videocodec/securevideo/baytrail/OMXVideoDecoderAVCSecure.cpp @@ -405,11 +405,7 @@ void OMXVideoDecoderAVCSecure::MemFreeSecure(OMX_U8 *pBuffer, OMX_PTR pUserData) } OMX_U8* OMXVideoDecoderAVCSecure::MemAllocSecure(OMX_U32 nSizeBytes) { - if (nSizeBytes > INPORT_BUFFER_SIZE) { - LOGE("Invalid size (%lu) of memory to allocate.", nSizeBytes); - return NULL; - } - LOGW_IF(nSizeBytes != INPORT_BUFFER_SIZE, "WARNING: MemAllocSEC asked to allocate buffer of size %lu (expected %d)", nSizeBytes, INPORT_BUFFER_SIZE); + // Ignore passed nSizeBytes, use INPORT_BUFFER_SIZE instead uint32_t index = 0; do { diff --git a/videocodec/securevideo/cherrytrail/OMXVideoDecoderAVCSecure.cpp b/videocodec/securevideo/cherrytrail/OMXVideoDecoderAVCSecure.cpp index 583eed2..de920b8 100644 --- a/videocodec/securevideo/cherrytrail/OMXVideoDecoderAVCSecure.cpp +++ b/videocodec/securevideo/cherrytrail/OMXVideoDecoderAVCSecure.cpp @@ -405,11 +405,7 @@ void OMXVideoDecoderAVCSecure::MemFreeSecure(OMX_U8 *pBuffer, OMX_PTR pUserData) } OMX_U8* OMXVideoDecoderAVCSecure::MemAllocSecure(OMX_U32 nSizeBytes) { - if (nSizeBytes > INPORT_BUFFER_SIZE) { - LOGE("Invalid size (%lu) of memory to allocate.", nSizeBytes); - return NULL; - } - LOGW_IF(nSizeBytes != INPORT_BUFFER_SIZE, "WARNING: MemAllocSEC asked to allocate buffer of size %lu (expected %d)", nSizeBytes, INPORT_BUFFER_SIZE); + // Ignore passed nSizeBytes, use INPORT_BUFFER_SIZE instead uint32_t index = 0; do { diff --git a/videocodec/securevideo/ctp/OMXVideoDecoderAVCSecure.cpp b/videocodec/securevideo/ctp/OMXVideoDecoderAVCSecure.cpp index abaf120..dda7026 100644 --- a/videocodec/securevideo/ctp/OMXVideoDecoderAVCSecure.cpp +++ b/videocodec/securevideo/ctp/OMXVideoDecoderAVCSecure.cpp @@ -372,11 +372,8 @@ void OMXVideoDecoderAVCSecure::MemFreeIMR(OMX_U8 *pBuffer, OMX_PTR pUserData) { } OMX_U8* OMXVideoDecoderAVCSecure::MemAllocIMR(OMX_U32 nSizeBytes) { - if (nSizeBytes > INPORT_BUFFER_SIZE) { - LOGE("Invalid size (%lu) of memory to allocate.", nSizeBytes); - return NULL; - } - LOGW_IF(nSizeBytes != INPORT_BUFFER_SIZE, "Size of memory to allocate is %lu", nSizeBytes); + // Ignore passed nSizeBytes, use INPORT_BUFFER_SIZE instead + for (int i = 0; i < INPORT_ACTUAL_BUFFER_COUNT; i++) { if (mIMRSlot[i].owner == NULL) { IMRDataBuffer *pBuffer = new IMRDataBuffer; diff --git a/videocodec/securevideo/merrifield/OMXVideoDecoderAVCSecure.cpp b/videocodec/securevideo/merrifield/OMXVideoDecoderAVCSecure.cpp index 590c9ea..2d1d2a4 100644 --- a/videocodec/securevideo/merrifield/OMXVideoDecoderAVCSecure.cpp +++ b/videocodec/securevideo/merrifield/OMXVideoDecoderAVCSecure.cpp @@ -387,11 +387,8 @@ void OMXVideoDecoderAVCSecure::MemFreeIMR(OMX_U8 *pBuffer, OMX_PTR pUserData) { } OMX_U8* OMXVideoDecoderAVCSecure::MemAllocIMR(OMX_U32 nSizeBytes) { - if (nSizeBytes > INPORT_BUFFER_SIZE) { - LOGE("Invalid size (%lu) of memory to allocate.", nSizeBytes); - return NULL; - } - LOGW_IF(nSizeBytes != INPORT_BUFFER_SIZE, "Size of memory to allocate is %lu", nSizeBytes); + // Ignore passed nSizeBytes, use INPORT_BUFFER_SIZE instead + for (int i = 0; i < INPORT_ACTUAL_BUFFER_COUNT; i++) { if (mIMRSlot[i].owner == NULL) { IMRDataBuffer *pBuffer = new IMRDataBuffer; diff --git a/videocodec/securevideo/merrplus/OMXVideoDecoderAVCSecure.cpp b/videocodec/securevideo/merrplus/OMXVideoDecoderAVCSecure.cpp index 590c9ea..2d1d2a4 100644 --- a/videocodec/securevideo/merrplus/OMXVideoDecoderAVCSecure.cpp +++ b/videocodec/securevideo/merrplus/OMXVideoDecoderAVCSecure.cpp @@ -387,11 +387,8 @@ void OMXVideoDecoderAVCSecure::MemFreeIMR(OMX_U8 *pBuffer, OMX_PTR pUserData) { } OMX_U8* OMXVideoDecoderAVCSecure::MemAllocIMR(OMX_U32 nSizeBytes) { - if (nSizeBytes > INPORT_BUFFER_SIZE) { - LOGE("Invalid size (%lu) of memory to allocate.", nSizeBytes); - return NULL; - } - LOGW_IF(nSizeBytes != INPORT_BUFFER_SIZE, "Size of memory to allocate is %lu", nSizeBytes); + // Ignore passed nSizeBytes, use INPORT_BUFFER_SIZE instead + for (int i = 0; i < INPORT_ACTUAL_BUFFER_COUNT; i++) { if (mIMRSlot[i].owner == NULL) { IMRDataBuffer *pBuffer = new IMRDataBuffer; |
