After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 775921 - multiqueue: Fix overflow on get_buffering_level()
multiqueue: Fix overflow on get_buffering_level()
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-10 09:55 UTC by Seungha Yang
Modified: 2016-12-13 09:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
multiqueue: Fix overflow on get_buffering_level() (1.54 KB, patch)
2016-12-10 09:56 UTC, Seungha Yang
none Details | Review
multiqueue: Fix overflow on get_buffering_level() (985 bytes, patch)
2016-12-10 11:02 UTC, Seungha Yang
committed Details | Review

Description Seungha Yang 2016-12-10 09:55:48 UTC
multiqueue: Fix overflow on get_buffering_level()

Since "time" uses guint64, and "bytes" does guint, scaling it into
gint can cause overflow
Comment 1 Seungha Yang 2016-12-10 09:56:36 UTC
Created attachment 341712 [details] [review]
multiqueue: Fix overflow on get_buffering_level()
Comment 2 Seungha Yang 2016-12-10 10:00:13 UTC
When we use buffering of multiqueue, max-size-time over MAX_INT (about 2.14sec) causes overflow.
This problem is similar to bug#755971
Comment 3 Jan Schmidt 2016-12-10 10:45:22 UTC
Review of attachment 341712 [details] [review]:

::: plugins/elements/gstmultiqueue.c
@@ +1134,3 @@
     if (sq->max_size.time > 0) {
       tmp =
+          gst_util_uint64_scale (sq->cur_time,

I think this line is the only actually needed change - because it's passing sq->max_size.time as a gint to gst_util_uint64_scale_int(). The result of gst_util_uint64_scale() should fit in an int just fine and gets truncated to that before returning anyway.
Comment 4 Seungha Yang 2016-12-10 11:02:08 UTC
Created attachment 341714 [details] [review]
multiqueue: Fix overflow on get_buffering_level()
Comment 5 Seungha Yang 2016-12-10 11:03:00 UTC
(In reply to Jan Schmidt from comment #3)
> Review of attachment 341712 [details] [review] [review]:

Thanks for reviewing this. I agree with you :)
Comment 6 Sebastian Dröge (slomo) 2016-12-11 11:31:57 UTC
Attachment 341714 [details] pushed as ce11dde - multiqueue: Fix overflow on get_buffering_level()