summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArda Coskunses <[email protected]>2016-12-22 14:55:03 -0700
committerJason Ekstrand <[email protected]>2016-12-22 14:09:34 -0800
commit01dd363e671ac3a457bc3ff60b43b04e108c33fc (patch)
treec76ae74b2ca2c78dd9022a402fdd2fdb7749293b /src
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 <[email protected]> Cc: "13.0" <[email protected]>
Diffstat (limited to 'src')
-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 25ba0c1b8ae..037aa50ba2a 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 };