From 7690d97189570d492d9e4eb391d8968ce28e1120 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 6 Nov 2014 18:09:04 +0100 Subject: [PATCH] video-converter: clamp 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 9b12f0ba70..71ce7b69e6 100644 --- a/gst-libs/gst/video/video-converter.c +++ b/gst-libs/gst/video/video-converter.c @@ -1379,9 +1379,12 @@ get_dest_line (GstLineCache * cache, gint idx, gpointer user_data) guint8 *line; gint pstride = convert->pack_pstride; gint out_x = convert->out_x; + guint cline; - GST_DEBUG ("get dest line %d", idx); - line = FRAME_GET_LINE (convert->dest, idx); + cline = CLAMP (idx, 0, convert->out_maxheight - 1); + + GST_DEBUG ("get dest line %d", cline); + line = FRAME_GET_LINE (convert->dest, cline); if (convert->borderline) { gint r_border = (out_x + convert->out_width) * pstride;