From 77069f01b15f5bcc9eddba1e8fb0bb2ab00e8446 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 7 Oct 2011 14:32:33 +0200 Subject: [PATCH] audiodecoder: make upstream queries and events MT-safe --- gst-libs/gst/audio/gstaudiodecoder.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c index 8ad677a098..3843f22050 100644 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -1556,6 +1556,10 @@ gst_audio_decoder_src_event (GstPad * pad, GstEvent * event) gboolean res = FALSE; dec = GST_AUDIO_DECODER (gst_pad_get_parent (pad)); + if (G_UNLIKELY (dec == NULL)) { + gst_event_unref (event); + return FALSE; + } GST_DEBUG_OBJECT (dec, "received event %d, %s", GST_EVENT_TYPE (event), GST_EVENT_TYPE_NAME (event)); @@ -1754,6 +1758,9 @@ gst_audio_decoder_src_query (GstPad * pad, GstQuery * query) gboolean res = FALSE; dec = GST_AUDIO_DECODER (GST_PAD_PARENT (pad)); + if (G_UNLIKELY (dec == NULL)) + return FALSE; + peerpad = gst_pad_get_peer (GST_PAD (dec->sinkpad)); GST_LOG_OBJECT (dec, "handling query: %" GST_PTR_FORMAT, query);