From c2f1064c2de1766a6a1d14fd0d0ca19003674ba1 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vcaputo@pengaru.com>
Date: Sun, 24 Nov 2019 13:52:50 -0800
Subject: montage: zero skipped fragments

Not doing this produces especially visible artifacts when shown
by rtv.
---
 src/modules/montage/montage.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'src/modules')

diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c
index 5502bae..ce2caf9 100644
--- a/src/modules/montage/montage.c
+++ b/src/modules/montage/montage.c
@@ -120,9 +120,6 @@ static int montage_fragmenter(void *context, const fb_fragment_t *fragment, unsi
 	if (!ret)
 		return 0;
 
-	if (number >= ctxt->n_modules)
-		return 0;
-
 	/* as these tiles are frames of their own rather than subfragments, override these values */
 	res_fragment->x = res_fragment->y = 0;
 	res_fragment->frame_width = res_fragment->width;
@@ -146,8 +143,14 @@ static void montage_render_fragment(void *context, unsigned cpu, fb_fragment_t *
 	montage_context_t		*ctxt = context;
 	const rototiller_module_t	*module = ctxt->modules[fragment->number];
 
-	if (skip_module(ctxt, module))
+	if (skip_module(ctxt,module) ||
+	    fragment->number >= ctxt->n_modules) {
+
+		fb_fragment_zero(fragment);
+
 		return;
+	}
+
 
 	/* since we're *already* in a threaded render of tiles, no further
 	 * threading within the montage tiles is desirable, so the per-module
-- 
cgit v1.2.3