From 04b0a37f879e13f8a5584afca2662a6c1d9e3c7c Mon Sep 17 00:00:00 2001 From: Alejandro Gonzalez Date: Sat, 27 Nov 2010 16:07:19 -0600 Subject: [PATCH] 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 --- gst/quicktime/gstqtmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/quicktime/gstqtmux.c b/gst/quicktime/gstqtmux.c index e138869236..f2ad7754c9 100644 --- a/gst/quicktime/gstqtmux.c +++ b/gst/quicktime/gstqtmux.c @@ -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))); } /*