From ed7e0e744fa3190224a0e9525d80dd33e7d9283e Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Tue, 4 Aug 2015 13:45:09 +0900 Subject: [PATCH] queue2: not update upstream size with negative value upstream_size can be negative but queue->upstream_size is unsigned type. to get a chance to update queue->upstream_size in gst_queue2_get_range() it should keep the default value. https://bugzilla.gnome.org/show_bug.cgi?id=753011 --- plugins/elements/gstqueue2.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 28d7e5e..34c922c 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -3176,7 +3176,13 @@ gst_queue2_update_upstream_size (GstQueue2 * queue) if (gst_pad_peer_query_duration (queue->sinkpad, GST_FORMAT_BYTES, &upstream_size)) { GST_INFO_OBJECT (queue, "upstream size: %" G_GINT64_FORMAT, upstream_size); - queue->upstream_size = upstream_size; + + /* upstream_size can be negative but queue->upstream_size is unsigned. + * Prevent setting negative values to it (the query can return -1) */ + if (upstream_size >= 0) + queue->upstream_size = upstream_size; + else + queue->upstream_size = 0; } } -- 2.7.4