mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-06 07:28:48 +00:00
multiqueue: Fix query unref race on flush
If the query has already been destroyed at this point, GST_IS_QUERY will read garbage, can return false and we will try to unref it again. Instead, make note of whether the item is a query when we dequeue it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1284>
This commit is contained in:
parent
3419ad9a45
commit
516f9592e7
1 changed files with 4 additions and 2 deletions
|
@ -2087,7 +2087,7 @@ gst_multi_queue_loop (GstPad * pad)
|
||||||
guint32 newid;
|
guint32 newid;
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
GstClockTimeDiff next_time;
|
GstClockTimeDiff next_time;
|
||||||
gboolean is_buffer;
|
gboolean is_buffer, is_query;
|
||||||
gboolean do_update_buffering = FALSE;
|
gboolean do_update_buffering = FALSE;
|
||||||
gboolean dropping = FALSE;
|
gboolean dropping = FALSE;
|
||||||
GstPad *srcpad = NULL;
|
GstPad *srcpad = NULL;
|
||||||
|
@ -2113,6 +2113,8 @@ next:
|
||||||
item = (GstMultiQueueItem *) sitem;
|
item = (GstMultiQueueItem *) sitem;
|
||||||
newid = item->posid;
|
newid = item->posid;
|
||||||
|
|
||||||
|
is_query = item->is_query;
|
||||||
|
|
||||||
/* steal the object and destroy the item */
|
/* steal the object and destroy the item */
|
||||||
object = gst_multi_queue_item_steal_object (item);
|
object = gst_multi_queue_item_steal_object (item);
|
||||||
gst_multi_queue_item_destroy (item);
|
gst_multi_queue_item_destroy (item);
|
||||||
|
@ -2358,7 +2360,7 @@ done:
|
||||||
|
|
||||||
out_flushing:
|
out_flushing:
|
||||||
{
|
{
|
||||||
if (object && !GST_IS_QUERY (object))
|
if (object && !is_query)
|
||||||
gst_mini_object_unref (object);
|
gst_mini_object_unref (object);
|
||||||
|
|
||||||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||||
|
|
Loading…
Reference in a new issue