mirror of
https://github.com/followmsi/android_hardware_qcom_media.git
synced 2024-10-31 22:47:35 +00:00
mm-video-v4l2: venc: Protect buffer from being freed while accessing am: a569853311
am: 2fcd17bd3a
am: 95656fe660
am: fab48ae9b1
Change-Id: Ie92d6a2786b82e7a812cef1524b1daaa9e53e62b
This commit is contained in:
commit
238577213a
1 changed files with 2 additions and 0 deletions
|
@ -2659,6 +2659,7 @@ OMX_ERRORTYPE omx_video::use_output_buffer(
|
|||
return OMX_ErrorBadParameter;
|
||||
}
|
||||
|
||||
auto_lock l(m_buf_lock);
|
||||
if (!m_out_mem_ptr) {
|
||||
output_use_buffer = true;
|
||||
int nBufHdrSize = 0;
|
||||
|
@ -3584,6 +3585,7 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
|
|||
nPortIndex, (unsigned int)m_sOutPortDef.nBufferCountActual);
|
||||
if (nPortIndex < m_sOutPortDef.nBufferCountActual &&
|
||||
BITMASK_PRESENT(&m_out_bm_count, nPortIndex)) {
|
||||
auto_lock l(m_buf_lock);
|
||||
// Clear the bit associated with it.
|
||||
BITMASK_CLEAR(&m_out_bm_count,nPortIndex);
|
||||
m_sOutPortDef.bPopulated = OMX_FALSE;
|
||||
|
|
Loading…
Reference in a new issue