diff options
author | Philip Lorenz <philip@bithub.de> | 2012-09-04 13:54:19 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2012-09-07 13:54:30 +0200 |
commit | 8bcfeb5a1c2d9adf323ce25b0dbff1c825eb96dd (patch) | |
tree | b04b88b6aa487ad67d8740d92740c49b816a38fc | |
parent | cdc63291821ff286c76e12dead74b5021f170ea9 (diff) |
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>
-rw-r--r-- | gst/vaapi/gstvaapidecode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapidecode.c b/gst/vaapi/gstvaapidecode.c index 6980d47..cd2d7f6 100644 --- a/gst/vaapi/gstvaapidecode.c +++ b/gst/vaapi/gstvaapidecode.c @@ -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); |