From 03d342e4b2988879f6981f5df11ff6540e4a5b85 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 17 Mar 2022 22:10:39 -0600 Subject: [PATCH] vulkan/wsi/x11: add null pointer check for the has_dri3_v1_2 test This fixes a crash (ver_reply is NULL) when DISPLAY points to a remote display. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6040 Signed-off-by: Brian Paul Reviewed-by: Adam Jackson Part-of: --- src/vulkan/wsi/wsi_common_x11.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 85a66a9..6b09d73 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -246,7 +246,7 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev, ver_cookie = xcb_dri3_query_version(conn, 1, 2); ver_reply = xcb_dri3_query_version_reply(conn, ver_cookie, NULL); - has_dri3_v1_2 = + has_dri3_v1_2 = ver_reply != NULL && (ver_reply->major_version > 1 || ver_reply->minor_version >= 2); free(ver_reply); } -- 2.7.4