video-blend: segfault when xpos >= video size

When the xpos is given as greater than or equal to the video size,
we get a segfault, due to improper condition.
Hence adding proper conditions.

https://bugzilla.gnome.org/show_bug.cgi?id=738984
This commit is contained in:
Vineeth T M 2014-10-23 14:41:13 +05:30 committed by Luis de Bethencourt
parent 900d0267d5
commit 2847a8108c

View file

@ -325,12 +325,10 @@ gst_video_blend (GstVideoFrame * dest,
/* adjust width/height if the src is bigger than dest */ /* adjust width/height if the src is bigger than dest */
if (x + src_width > dest_width) if (x + src_width > dest_width)
if (dest_width > x) src_width = dest_width - x;
src_width = dest_width - x;
if (y + src_height > dest_height) if (y + src_height > dest_height)
if (dest_height > y) src_height = dest_height - y;
src_height = dest_height - y;
/* Mainloop doing the needed conversions, and blending */ /* Mainloop doing the needed conversions, and blending */
for (i = y; i < y + src_height; i++) { for (i = y; i < y + src_height; i++) {