mirror of
https://github.com/brl/mutter.git
synced 2024-11-29 03:20:46 -05:00
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1697>
This commit is contained in:
parent
08ad107df5
commit
ca95ccdef0
@ -745,6 +745,7 @@ on_stream_add_buffer (void *data,
|
|||||||
|
|
||||||
spa_data[0].mapoffset = 0;
|
spa_data[0].mapoffset = 0;
|
||||||
spa_data[0].maxsize = stride * priv->video_format.size.height;
|
spa_data[0].maxsize = stride * priv->video_format.size.height;
|
||||||
|
spa_data[0].data = NULL;
|
||||||
|
|
||||||
dmabuf_handle =
|
dmabuf_handle =
|
||||||
meta_screen_cast_create_dma_buf_handle (screen_cast,
|
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].type = SPA_DATA_DmaBuf;
|
||||||
spa_data[0].flags = SPA_DATA_FLAG_READWRITE;
|
spa_data[0].flags = SPA_DATA_FLAG_READWRITE;
|
||||||
spa_data[0].fd = cogl_dma_buf_handle_get_fd (dmabuf_handle);
|
spa_data[0].fd = cogl_dma_buf_handle_get_fd (dmabuf_handle);
|
||||||
spa_data[0].data = NULL;
|
|
||||||
|
|
||||||
g_hash_table_insert (priv->dmabuf_handles,
|
g_hash_table_insert (priv->dmabuf_handles,
|
||||||
GINT_TO_POINTER (spa_data[0].fd),
|
GINT_TO_POINTER (spa_data[0].fd),
|
||||||
|
Loading…
Reference in New Issue
Block a user