From a422756b7d73b48d3d10d15066a61e9332370719 Mon Sep 17 00:00:00 2001 From: Brendan King Date: Mon, 21 Jun 2021 17:05:17 +0100 Subject: [PATCH 56/67] vulkan/wsi: check the DRI3 and Present XCB reply pointers Check that the DRI3 and Present version replies are not NULL before accessing the version fields. --- src/vulkan/wsi/wsi_common_x11.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 9dce78eddeb..9eb624df640 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -216,7 +216,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); } @@ -230,7 +230,7 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev, ver_cookie = xcb_present_query_version(conn, 1, 2); ver_reply = xcb_present_query_version_reply(conn, ver_cookie, NULL); - has_present_v1_2 = + has_present_v1_2 = ver_reply != NULL && (ver_reply->major_version > 1 || ver_reply->minor_version >= 2); free(ver_reply); } -- 2.25.1