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>
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 };