queue2: Only update current level if we already downloaded a range
authorSebastian Dröge <slomo@circular-chaos.org>
Tue, 10 Sep 2013 08:15:03 +0000 (10:15 +0200)
committerSebastian Dröge <slomo@circular-chaos.org>
Tue, 10 Sep 2013 08:15:03 +0000 (10:15 +0200)
Otherwise queue->level is NULL and dereferencing that is not a good
idea in general.

https://bugzilla.gnome.org/show_bug.cgi?id=707648

plugins/elements/gstqueue2.c

index 6bef04d..2452385 100644 (file)
@@ -877,7 +877,8 @@ update_buffering (GstQueue2 * queue)
   gboolean post = FALSE;
 
   /* Ensure the variables used to calculate buffering state are up-to-date. */
-  update_cur_level (queue, queue->current);
+  if (queue->current)
+    update_cur_level (queue, queue->current);
   update_in_rates (queue);
 
   if (!get_buffering_percent (queue, NULL, &percent))