From 2847a8108c50c8a32723b06d70e4563988ee2e2e Mon Sep 17 00:00:00 2001 From: Vineeth T M Date: Thu, 23 Oct 2014 14:41:13 +0530 Subject: [PATCH] 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 --- gst-libs/gst/video/video-blend.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/video/video-blend.c b/gst-libs/gst/video/video-blend.c index 7aa7173ddb..835b7bbdc2 100644 --- a/gst-libs/gst/video/video-blend.c +++ b/gst-libs/gst/video/video-blend.c @@ -325,12 +325,10 @@ gst_video_blend (GstVideoFrame * dest, /* adjust width/height if the src is bigger than dest */ 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 (dest_height > y) - src_height = dest_height - y; + src_height = dest_height - y; /* Mainloop doing the needed conversions, and blending */ for (i = y; i < y + src_height; i++) {