From b25f8aebf533c261a5cb92c7c3943ad618053d34 Mon Sep 17 00:00:00 2001
From: Daniel Stone <daniels@collabora.com>
Date: Thu, 18 Nov 2021 14:54:25 +0000
Subject: [PATCH] remoting: Fix warnings for multi-planar interface

GStreamer can accept up to four planes for a buffer; gcc isn't _quite_
smart enough to figure out that only the first plane of offset/stride
will be accessed and so throws a warning that the params are too small.
Fix that by making them arrays.

Signed-off-by: Daniel Stone <daniels@collabora.com>
---
 remoting/remoting-plugin.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/remoting/remoting-plugin.c b/remoting/remoting-plugin.c
index 6aa4ec8af1..e5f5ca4aa2 100644
--- a/remoting/remoting-plugin.c
+++ b/remoting/remoting-plugin.c
@@ -572,7 +572,8 @@ remoting_output_frame(struct weston_output *output_base, int fd, int stride,
 	struct wl_event_loop *loop;
 	GstBuffer *buf;
 	GstMemory *mem;
-	gsize offset = 0;
+	gsize offsets[4] = { 0, };
+	gint strides[4] = { stride, };
 	struct mem_free_cb_data *cb_data;
 	struct gst_frame_buffer_data *frame_data;
 
@@ -594,8 +595,8 @@ remoting_output_frame(struct weston_output *output_base, int fd, int stride,
 				       mode->width,
 				       mode->height,
 				       1,
-				       &offset,
-				       &stride);
+				       offsets,
+				       strides);
 
 	cb_data->output = output;
 	cb_data->output_buffer = output_buffer;
-- 
GitLab