summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2021-07-15 10:19:53 +0100
committerDaniel Stone <daniels@collabora.com>2021-07-15 21:57:30 +0100
commit49a7c92793ebcc4e2814ef295e51673dc4c9674c (patch)
tree23a58af8f4179b90350c8c5cecc533dab324f548
parent1061ebb6da6435caf4f38d6d0a592ab6d1ca7bdc (diff)
vulkan/wsi/wayland: Initialise wl_shm pointer in VkImage
We don't explicitly calloc the wsi_wl_image to zero; anything that's expected to be valid needs to be explicitly initialised. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5063 Fixes: 6b36f35734a9 ("vulkan/wsi/wl: add wl_shm support for lavapipe.") Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Tested-by: Jan Beich <jbeich@freebsd.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11909>
-rw-r--r--src/vulkan/wsi/wsi_common_wayland.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index cdafae13ee0..f7ecc85b248 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -1218,8 +1218,10 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
/* Mark a bunch of stuff as NULL. This way we can just call
* destroy_swapchain for cleanup.
*/
- for (uint32_t i = 0; i < num_images; i++)
+ for (uint32_t i = 0; i < num_images; i++) {
chain->images[i].buffer = NULL;
+ chain->images[i].data_ptr = NULL;
+ }
chain->surface = NULL;
chain->frame = NULL;