From b862cc23f203f1fd87edf44a32312491dce8bb91 Mon Sep 17 00:00:00 2001 From: Christian König Date: Tue, 28 Jan 2014 06:21:14 -0700 Subject: st/omx: add workaround for bug in Bellagio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not blocking for the message thread can lead to accessing freed up memory. Signed-off-by: Christian König --- src/gallium/state_trackers/omx/entrypoint.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gallium/state_trackers/omx/entrypoint.c') diff --git a/src/gallium/state_trackers/omx/entrypoint.c b/src/gallium/state_trackers/omx/entrypoint.c index bc8664b96a3..fb46849bf66 100644 --- a/src/gallium/state_trackers/omx/entrypoint.c +++ b/src/gallium/state_trackers/omx/entrypoint.c @@ -98,3 +98,16 @@ void omx_put_screen(void) } pipe_mutex_unlock(omx_lock); } + +OMX_ERRORTYPE omx_workaround_Destructor(OMX_COMPONENTTYPE *comp) +{ + omx_base_component_PrivateType* priv = (omx_base_component_PrivateType*)comp->pComponentPrivate; + + priv->state = OMX_StateInvalid; + tsem_up(priv->messageSem); + + /* wait for thread to exit */; + pthread_join(priv->messageHandlerThread, NULL); + + return omx_base_component_Destructor(comp); +} -- cgit v1.2.3