summaryrefslogtreecommitdiff
path: root/src/vulkan
diff options
context:
space:
mode:
authorArda Coskunses <acoskunses@gmail.com>2016-12-22 14:55:03 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-12-22 14:09:34 -0800
commit01dd363e671ac3a457bc3ff60b43b04e108c33fc (patch)
treec76ae74b2ca2c78dd9022a402fdd2fdb7749293b /src/vulkan
parent7a4ea95f1c5257e79a7a207eccff81c558c04d46 (diff)
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@jlekstrand.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/wsi/wsi_common_x11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 25ba0c1b8a..037aa50ba2 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 };