mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
vaapidecode: acquire lock only if the mutex exists.
When playback stops the GstVaapiDecode object is reset into a clean state. However, surfaces may still be referenced by library users and unreferencing them after the reset triggers an access to an unset mutex. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
cdc6329182
commit
8bcfeb5a1c
1 changed files with 3 additions and 0 deletions
|
@ -174,6 +174,9 @@ gst_vaapidecode_update_src_caps(GstVaapiDecode *decode, GstCaps *caps)
|
|||
static void
|
||||
gst_vaapidecode_release(GstVaapiDecode *decode, GObject *dead_object)
|
||||
{
|
||||
if (!decode->decoder_mutex || !decode->decoder_ready)
|
||||
return;
|
||||
|
||||
g_mutex_lock(decode->decoder_mutex);
|
||||
g_cond_signal(decode->decoder_ready);
|
||||
g_mutex_unlock(decode->decoder_mutex);
|
||||
|
|
Loading…
Reference in a new issue