0056-vulkan-wsi-check-the-DRI3-and-Present-XCB-reply-poin.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. From eae8f032db504187079fe3ae3fa56990593cd857 Mon Sep 17 00:00:00 2001
  2. From: Brendan King <Brendan.King@imgtec.com>
  3. Date: Mon, 21 Jun 2021 17:05:17 +0100
  4. Subject: [PATCH] vulkan/wsi: check the DRI3 and Present XCB reply pointers
  5. Check that the DRI3 and Present version replies are not NULL
  6. before accessing the version fields.
  7. ---
  8. src/vulkan/wsi/wsi_common_x11.c | 4 ++--
  9. 1 file changed, 2 insertions(+), 2 deletions(-)
  10. diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
  11. index 9dce78e..9eb624d 100644
  12. --- a/src/vulkan/wsi/wsi_common_x11.c
  13. +++ b/src/vulkan/wsi/wsi_common_x11.c
  14. @@ -216,7 +216,7 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev,
  15. ver_cookie = xcb_dri3_query_version(conn, 1, 2);
  16. ver_reply = xcb_dri3_query_version_reply(conn, ver_cookie, NULL);
  17. - has_dri3_v1_2 =
  18. + has_dri3_v1_2 = ver_reply != NULL &&
  19. (ver_reply->major_version > 1 || ver_reply->minor_version >= 2);
  20. free(ver_reply);
  21. }
  22. @@ -230,7 +230,7 @@ wsi_x11_connection_create(struct wsi_device *wsi_dev,
  23. ver_cookie = xcb_present_query_version(conn, 1, 2);
  24. ver_reply = xcb_present_query_version_reply(conn, ver_cookie, NULL);
  25. - has_present_v1_2 =
  26. + has_present_v1_2 = ver_reply != NULL &&
  27. (ver_reply->major_version > 1 || ver_reply->minor_version >= 2);
  28. free(ver_reply);
  29. }