summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorLuis de Bethencourt <luis@debethencourt.com>2015-08-28 15:21:11 +0100
committerLuis de Bethencourt <luis@debethencourt.com>2015-08-28 15:21:13 +0100
commitbca444ea4a84c39e9989681f892f6e4cb2033cf9 (patch)
tree779f8b382394bd823bf3d6588a299918abe9f458 /gst
parent1e14ceedb38e063e4c5558e8aa28681a57049c13 (diff)
downloadgstreamer-plugins-bad-bca444ea4a84c39e9989681f892f6e4cb2033cf9.tar.gz
compositor: remove check for below zero for unsigned value
CLAMP checks both if value is '< 0' and '> max'. Value will never be a negative number since it is an unsigned integer. Removing that check and only checking if it is bigger than max by using MIN(). CID 1320707
Diffstat (limited to 'gst')
-rw-r--r--gst/compositor/compositor.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gst/compositor/compositor.c b/gst/compositor/compositor.c
index 9aa651f95..66927ba3a 100644
--- a/gst/compositor/compositor.c
+++ b/gst/compositor/compositor.c
@@ -362,10 +362,10 @@ clamp_rectangle (guint x, guint y, guint w, guint h, guint outer_width,
* the case where (say, with negative xpos/ypos or w/h greater than the output
* size) the non-obscured portion of the frame could be outside the bounds of
* the video itself and hence not visible at all */
- clamped.x = CLAMP (x, 0, outer_width);
- clamped.y = CLAMP (y, 0, outer_height);
- clamped.w = CLAMP (x2, 0, outer_width) - clamped.x;
- clamped.h = CLAMP (y2, 0, outer_height) - clamped.y;
+ clamped.x = MIN (x, outer_width);
+ clamped.y = MIN (y, outer_height);
+ clamped.w = MIN (x2, outer_width) - clamped.x;
+ clamped.h = MIN (y2, outer_height) - clamped.y;
return clamped;
}