Commit 04b0a37f authored by Alejandro Gonzalez's avatar Alejandro Gonzalez Committed by Tim-Philipp Müller
Browse files

qtmux: gst_qtmux_check_difference verify before subtract

Avoid negative overflow by checking the order of operands
on subtraction of unsigned integers.

https://bugzilla.gnome.org/show_bug.cgi?id=635878
parent 9c198ffe
......@@ -1904,7 +1904,7 @@ static gboolean inline
gst_qtmux_check_difference (GstQTMux * qtmux, GstClockTime a,
GstClockTime b, GstClockTime magn)
{
return ((a - b >= (magn >> 1)) || (b - a >= (magn >> 1)));
return ((a >= b) ? (a - b >= (magn >> 1)) : (b - a >= (magn >> 1)));
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment