diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2015-09-05 01:50:41 +0530 |
---|---|---|
committer | Thibault Saunier <tsaunier@gnome.org> | 2015-09-04 23:32:36 +0200 |
commit | cf786a9399d6f9d723000d35d3e1ad2a52a09295 (patch) | |
tree | a54d130c80df2a89a583a02d70edeb339f3df775 /gst/compositor | |
parent | de29038d1e0a102181f062061f9b1d330721017f (diff) | |
download | gstreamer-plugins-bad-cf786a9399d6f9d723000d35d3e1ad2a52a09295.tar.gz |
compositor: Ensure all arguments to CLAMP are signed int
If any of the arguments to CLAMP are unsigned integers, the comparison causes
an automatic conversion of the signed int to unsigned, which causes -1 to become
UINT_MAX and get clamped to the high value of the CLAMP instead of 0.
See 716 at http://c0x.coding-guidelines.com/6.3.1.8.html
Also add a test for this.
https://bugzilla.gnome.org/show_bug.cgi?id=754576
Diffstat (limited to 'gst/compositor')
-rw-r--r-- | gst/compositor/compositor.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gst/compositor/compositor.c b/gst/compositor/compositor.c index 64d05ac18..d015d85e1 100644 --- a/gst/compositor/compositor.c +++ b/gst/compositor/compositor.c @@ -351,8 +351,8 @@ is_rectangle_contained (GstVideoRectangle rect1, GstVideoRectangle rect2) } static GstVideoRectangle -clamp_rectangle (gint x, gint y, gint w, gint h, guint outer_width, - guint outer_height) +clamp_rectangle (gint x, gint y, gint w, gint h, gint outer_width, + gint outer_height) { gint x2 = x + w; gint y2 = y + h; |