diff --git a/gst-libs/gst/video/video-blend.c b/gst-libs/gst/video/video-blend.c index 835b7bbdc2..7aa7173ddb 100644 --- a/gst-libs/gst/video/video-blend.c +++ b/gst-libs/gst/video/video-blend.c @@ -325,10 +325,12 @@ gst_video_blend (GstVideoFrame * dest, /* adjust width/height if the src is bigger than dest */ if (x + src_width > dest_width) - src_width = dest_width - x; + if (dest_width > x) + src_width = dest_width - x; if (y + src_height > dest_height) - src_height = dest_height - y; + if (dest_height > y) + src_height = dest_height - y; /* Mainloop doing the needed conversions, and blending */ for (i = y; i < y + src_height; i++) {