multiqueue: never unref queries we do not own
authorThibault Saunier <tsaunier@igalia.com>
Thu, 20 Jun 2019 03:29:24 +0000 (23:29 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 8 Aug 2019 13:58:52 +0000 (14:58 +0100)
The `query` argument of gst_pad_query is "transfer none".

Query objects are "borrowed" by the pad query handlers and those
should never unref them.

This was leading to double freed queries in a very racy way with nested
GESTimelines.

plugins/elements/gstmultiqueue.c

index 76006a2..ea48901 100644 (file)
@@ -2049,7 +2049,7 @@ next:
 
 out_flushing:
   {
-    if (object)
+    if (object && !GST_IS_QUERY (object))
       gst_mini_object_unref (object);
 
     GST_MULTI_QUEUE_MUTEX_LOCK (mq);