Mesa (master): vulkan/wsi/x11: don't crash on null visual
Jason Ekstrand
jekstrand at kemper.freedesktop.org
Thu Dec 22 22:07:48 UTC 2016
Module: Mesa
Branch: master
Commit: 6caa64e072bc080625bf3548e2f00df6d2281ee4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6caa64e072bc080625bf3548e2f00df6d2281ee4
Author: Arda Coskunses <acoskunses at gmail.com>
Date: Thu Dec 22 14:55:03 2016 -0700
vulkan/wsi/x11: don't crash on null visual
When application window closed unexpectedly due to
lost window visualtypes getting invlaid parameters
which is causing a crash. Necessary check is added
to prevent the crash.
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
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 25ba0c1..037aa50 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -349,6 +349,9 @@ x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface,
xcb_visualtype_t *visual =
get_visualtype_for_window(conn, window, &visual_depth);
+ if (!visual)
+ return VK_ERROR_SURFACE_LOST_KHR;
+
geom = xcb_get_geometry_reply(conn, geom_cookie, &err);
if (geom) {
VkExtent2D extent = { geom->width, geom->height };
More information about the mesa-commit
mailing list