From 308d21c71f12f9546b3197e03a4288509287d76c Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 31 Oct 2014 10:38:15 +0100 Subject: [PATCH] video-converter: clamp output lines --- gst-libs/gst/video/video-converter.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video-converter.c b/gst-libs/gst/video/video-converter.c index edcf67c..9099cab 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -1273,8 +1273,11 @@ do_vscale_lines (GstLineCache * cache, gint line, GstVideoConverter * convert) { gpointer *lines, destline; guint sline, n_lines; + guint cline; + + cline = CLAMP (line, 0, convert->out_height - 1); - gst_video_scaler_get_coeff (convert->v_scaler, line, &sline, &n_lines); + gst_video_scaler_get_coeff (convert->v_scaler, cline, &sline, &n_lines); lines = gst_line_cache_get_lines (convert->vscale_lines, sline, n_lines); destline = get_temp_line (convert, convert->out_x); @@ -1283,7 +1286,7 @@ do_vscale_lines (GstLineCache * cache, gint line, GstVideoConverter * convert) * to be careful to not do in-place modifications later */ GST_DEBUG ("vresample line %d %d-%d", line, sline, sline + n_lines - 1); gst_video_scaler_vertical (convert->v_scaler, GST_VIDEO_FORMAT_AYUV, - lines, destline, line, convert->v_scale_width); + lines, destline, cline, convert->v_scale_width); gst_line_cache_add_line (cache, line, destline); -- 2.7.4