[Bug 755971] queue2: may overflow unsigned integer arithmetic
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Mon Oct 5 23:57:25 PDT 2015
https://bugzilla.gnome.org/show_bug.cgi?id=755971
--- Comment #4 from Aleksander Wabik <awabik at opera.com> ---
Created attachment 312709
--> https://bugzilla.gnome.org/attachment.cgi?id=312709&action=edit
The fix
Attaching the patch. It does 2 things:
- uses gst_util_uint64_scale() so the percent calculation does not overflow (on
guint64 type)
- uses MIN (100, gst_util_uint64_scale(...)) to ensure that the result also
does not overflow integer.
It does not remove "if (perc > 100) perc = 100;" check, as that one is done
after scaling the percent to high_percent, so it's actually needed.
--
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list