Not blocking for the message thread can lead to accessing freed up memory.
Signed-off-by: Christian König <christian.koenig@amd.com>
}
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);
+}
struct vl_screen *omx_get_screen(void);
void omx_put_screen(void);
+OMX_ERRORTYPE omx_workaround_Destructor(OMX_COMPONENTTYPE *comp);
+
#endif
if (priv->screen)
omx_put_screen();
- omx_base_filter_Destructor(comp);
- return OMX_ErrorNone;
+ return omx_workaround_Destructor(comp);
}
static OMX_ERRORTYPE vid_dec_SetParameter(OMX_HANDLETYPE handle, OMX_INDEXTYPE idx, OMX_PTR param)