From c9f132986c51a10de524a18c1bf31fc24b035b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 21 Oct 2019 17:28:46 +0300 Subject: [PATCH] video-scaler: Correctly handle interlaced vertical scalers in gst_video_scaler_2d() We need to provide twice as many lines as usual to the scaling function as every second lines would be skipped. Without this we read from random memory and produce colorful output and crashes. --- gst-libs/gst/video/video-scaler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/video/video-scaler.c b/gst-libs/gst/video/video-scaler.c index b0026ff45d..1c6ebe673a 100644 --- a/gst-libs/gst/video/video-scaler.c +++ b/gst-libs/gst/video/video-scaler.c @@ -1491,6 +1491,9 @@ gst_video_scaler_2d (GstVideoScaler * hscale, GstVideoScaler * vscale, realloc_tmplines (vscale, n_elems, width); v_taps = vscale->resampler.max_taps; + if (vscale->flags & GST_VIDEO_SCALER_FLAG_INTERLACED) + v_taps *= 2; + lines = g_alloca (v_taps * sizeof (gpointer)); if (hscale == NULL) {