From 8ff295a788f275a47397f9ea5c3d0f8d1c7b846f Mon Sep 17 00:00:00 2001 From: Havard Graff Date: Sun, 20 Mar 2011 08:59:33 +0100 Subject: [PATCH] audioresample: Make src query MT-safe It is possible that the element might be going down while the event arrives --- gst/audioresample/gstaudioresample.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 92e38dd07f..8f9ea3be81 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -1264,8 +1264,12 @@ static gboolean gst_audio_resample_query (GstPad * pad, GstQuery * query) { GstAudioResample *resample = GST_AUDIO_RESAMPLE (gst_pad_get_parent (pad)); - GstBaseTransform *trans = GST_BASE_TRANSFORM (resample); + GstBaseTransform *trans; gboolean res = TRUE; + if (G_UNLIKELY (resample == NULL)) + return FALSE; + + trans = GST_BASE_TRANSFORM (resample); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_LATENCY: