diff options
author | ywan171 <yi.a.wang@intel.com> | 2014-10-21 16:10:11 +0800 |
---|---|---|
committer | Pat Tjin <pattjin@google.com> | 2014-10-21 16:50:24 +0000 |
commit | beb8f2079e8c43739ed356319caba47a7717e74a (patch) | |
tree | 644ada648236a7b0948058eb66b7501294a45bcf | |
parent | 5da72011e0c14cf41ac9a2b3f93e59ff7b8be219 (diff) | |
download | android_hardware_intel_common_omx-components-beb8f2079e8c43739ed356319caba47a7717e74a.tar.gz android_hardware_intel_common_omx-components-beb8f2079e8c43739ed356319caba47a7717e74a.tar.bz2 android_hardware_intel_common_omx-components-beb8f2079e8c43739ed356319caba47a7717e74a.zip |
fix memleak in vp9 HWR plugin which will lead to cts failure
Bug: 18023655
Change-Id: I60dff6aafe3fc6d43d07f6c404bc9dd45ed8d597
Signed-off-by: ywan171 <yi.a.wang@intel.com>
-rw-r--r-- | videocodec/OMXVideoDecoderVP9HWR.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/videocodec/OMXVideoDecoderVP9HWR.cpp b/videocodec/OMXVideoDecoderVP9HWR.cpp index ec97bac..8497f09 100644 --- a/videocodec/OMXVideoDecoderVP9HWR.cpp +++ b/videocodec/OMXVideoDecoderVP9HWR.cpp @@ -344,26 +344,13 @@ OMX_ERRORTYPE OMXVideoDecoderVP9HWR::ProcessorInit(void) OMX_ERRORTYPE OMXVideoDecoderVP9HWR::ProcessorDeinit(void) { - mOMXBufferHeaderTypePtrNum = 0; - memset(&mGraphicBufferParam, 0, sizeof(mGraphicBufferParam)); - destroyDecoder(); unsigned int i = 0; - - for (i = 0; i < MAX_NATIVE_BUFFER_COUNT; i++) { - delete extMIDs[i]->m_surface; - free(extMIDs[i]); - } - if (mWorkingMode == GRAPHICBUFFER_MODE) { for (i = 0; i < mOMXBufferHeaderTypePtrNum; i++) { if (extMIDs[i]->m_surface != NULL) { vaDestroySurfaces(mVADisplay, extMIDs[i]->m_surface, 1); } - if (extMIDs[i]->m_usrAddr != NULL) { - free(extMIDs[i]->m_usrAddr); - extMIDs[i]->m_usrAddr = NULL; - } } } else if (mWorkingMode == RAWDATA_MODE) { @@ -374,6 +361,12 @@ OMX_ERRORTYPE OMXVideoDecoderVP9HWR::ProcessorDeinit(void) } } } + mOMXBufferHeaderTypePtrNum = 0; + memset(&mGraphicBufferParam, 0, sizeof(mGraphicBufferParam)); + for (i = 0; i < MAX_NATIVE_BUFFER_COUNT; i++) { + delete extMIDs[i]->m_surface; + free(extMIDs[i]); + } return OMXComponentCodecBase::ProcessorDeinit(); } |