From ca95ccdef08ee7c1e6da6982ec47b2a78afdd3d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 1 Feb 2021 18:32:33 +0100 Subject: [PATCH] screen-cast/src: Always first set spa buffer data to NULL We use that elsewhere for sanity checking, and it's not initialized to anything, so might be pointing to invalid memory if buffer allocation failed. Part-of: --- src/backends/meta-screen-cast-stream-src.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c index 3b0931648..5d3440e5d 100644 --- a/src/backends/meta-screen-cast-stream-src.c +++ b/src/backends/meta-screen-cast-stream-src.c @@ -745,6 +745,7 @@ on_stream_add_buffer (void *data, spa_data[0].mapoffset = 0; spa_data[0].maxsize = stride * priv->video_format.size.height; + spa_data[0].data = NULL; dmabuf_handle = meta_screen_cast_create_dma_buf_handle (screen_cast, @@ -756,7 +757,6 @@ on_stream_add_buffer (void *data, spa_data[0].type = SPA_DATA_DmaBuf; spa_data[0].flags = SPA_DATA_FLAG_READWRITE; spa_data[0].fd = cogl_dma_buf_handle_get_fd (dmabuf_handle); - spa_data[0].data = NULL; g_hash_table_insert (priv->dmabuf_handles, GINT_TO_POINTER (spa_data[0].fd),