diff options
author | Eunhae Choi <eunhae1.choi@samsung.com> | 2015-08-04 13:45:09 +0900 |
---|---|---|
committer | Thiago Santos <thiagoss@osg.samsung.com> | 2015-08-04 07:03:24 -0300 |
commit | ed7e0e744fa3190224a0e9525d80dd33e7d9283e (patch) | |
tree | 5ce8111ed00c9b50ff8643c508299201889bb85b | |
parent | fa370153bc094335eeeed7febeb1d454c8772a4a (diff) |
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
-rw-r--r-- | plugins/elements/gstqueue2.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 28d7e5e1a..34c922c75 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; } } |