From 3ee30d98ff3606d79f9d597674bf3812957ae1b5 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 24 Jun 2021 20:32:16 +0200 Subject: [PATCH] vulkan/wsi/wayland: handle dmabuf params allocation failure Return VK_ERROR_OUT_OF_HOST_MEMORY if zwp_linux_dmabuf_v1_create_params fails. Signed-off-by: Simon Ser Acked-by: Lionel Landwerlin Part-of: --- src/vulkan/wsi/wsi_common_wayland.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 219c77692c4..7530f58ec3a 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -954,6 +954,8 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain, if (display->dmabuf.wl_dmabuf) { struct zwp_linux_buffer_params_v1 *params = zwp_linux_dmabuf_v1_create_params(display->dmabuf.wl_dmabuf); + if (!params) + goto fail_image; for (int i = 0; i < image->base.num_planes; i++) { zwp_linux_buffer_params_v1_add(params,