Mesa (master): vulkan/wsi/x11: don't crash on null wsi x11 connection

Jason Ekstrand jekstrand at kemper.freedesktop.org
Thu Dec 22 22:09:59 UTC 2016


Module: Mesa
Branch: master
Commit: 99de7b752546c3f87aa8a18f72fd46856270555f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=99de7b752546c3f87aa8a18f72fd46856270555f

Author: Arda Coskunses <acoskunses at gmail.com>
Date:   Thu Dec 22 15:03:11 2016 -0700

vulkan/wsi/x11: don't crash on null wsi x11 connection

Without this check driver crash when application window
closed unexpectedly.

Acked-by: Edward O'Callaghan <funfunctor at folklore194.net>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Cc: "13.0" <mesa-stable at lists.freedesktop.org>

---

 src/vulkan/wsi/wsi_common_x11.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 037aa50..7126838 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -261,6 +261,9 @@ VkBool32 wsi_get_physical_device_xcb_presentation_support(
    struct wsi_x11_connection *wsi_conn =
       wsi_x11_get_connection(wsi_device, alloc, connection);
 
+   if (!wsi_conn)
+      return false;
+
    if (!wsi_conn->has_dri3) {
       fprintf(stderr, "vulkan: No DRI3 support\n");
       return false;




More information about the mesa-commit mailing list