[Bug 752336] New: dashdemux: duration field could overflow
GStreamer (GNOME Bugzilla)
bugzilla at gnome.org
Mon Jul 13 08:53:23 PDT 2015
https://bugzilla.gnome.org/show_bug.cgi?id=752336
Bug ID: 752336
Summary: dashdemux: duration field could overflow
Classification: Platform
Product: GStreamer
Version: git master
OS: Linux
Status: NEW
Severity: normal
Priority: Normal
Component: gst-plugins-bad
Assignee: gstreamer-bugs at lists.freedesktop.org
Reporter: florin.apostol at oregan.net
QA Contact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
The gst_mpdparser_get_xml_prop_duration function reads a duration from xml
file, converts this to ms and returns it into a gint64 variable. The value will
later be usually converted to nanoseconds and stored into a GstClockTime (which
is also 64 bits).
Durations longer than 584 years will overflow the GstClockTime datatype. For
example, a duration of P584Y will be 0xFF9669C01BD80000 nanoseconds, but a
duration of P585Y will be 0x00067393497B0000 nanoseconds.
The gst_mpdparser_get_xml_prop_duration function has the following algorithm
for converting the read values into a ms value:
*property_value =
sign * ((((((gint64) years * 365 + months * 30 + days) * 24 +
hours) * 60 + minutes) * 60 + seconds) * 1000 + decimals);
This should be enhanced to detect overflows, and more, future overflows when
this will be converted to a nanosecond value. Basically, the function should
return an error if the duration is bigger than 584 (and something) years.
--
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