Mesa (main): vulkan/wsi/wayland: Initialise wl_shm pointer in VkImage

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 15 21:34:05 UTC 2021


Module: Mesa
Branch: main
Commit: 49a7c92793ebcc4e2814ef295e51673dc4c9674c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=49a7c92793ebcc4e2814ef295e51673dc4c9674c

Author: Daniel Stone <daniels at collabora.com>
Date:   Thu Jul 15 10:19:53 2021 +0100

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 at jlekstrand.net>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Tested-by: Jan Beich <jbeich at freebsd.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11909>

---

 src/vulkan/wsi/wsi_common_wayland.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;
 



More information about the mesa-commit mailing list