compositor: Ensure all arguments to CLAMP are signed int
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 4 Sep 2015 20:20:41 +0000 (01:50 +0530)
committerThibault Saunier <tsaunier@gnome.org>
Fri, 4 Sep 2015 21:32:36 +0000 (23:32 +0200)
commitcf786a9399d6f9d723000d35d3e1ad2a52a09295
treea54d130c80df2a89a583a02d70edeb339f3df775
parentde29038d1e0a102181f062061f9b1d330721017f
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
gst/compositor/compositor.c
tests/check/elements/compositor.c