diff options
| author | Arda Coskunses <arda@lunarg.com> | 2017-01-19 10:41:27 -0700 |
|---|---|---|
| committer | Arda Coskunses <arda@lunarg.com> | 2017-01-19 13:10:02 -0700 |
| commit | 67d3f26427c2bb8f5a436b9447c49e220252b28f (patch) | |
| tree | 0784e7ac795d65e75cf70d44b081ecfe952e2741 | |
| parent | aef8f2aa8534a48ba1898b5fd712c82970c30afd (diff) | |
| download | usermoji-67d3f26427c2bb8f5a436b9447c49e220252b28f.tar.xz | |
Vulkaninfo: Vulkaninfo crashes when DISPLAY is invalid
On Linux the following command crashes:
DISPLAY=foobar ./vulkaninfo
This patch fixes this issue.
https://github.com/LunarG/VulkanTools/issues/125
Change-Id: Ibb8d7b8b6cb4dc730aab9f5b4311e744c903029b
| -rw-r--r-- | demos/vulkaninfo.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/demos/vulkaninfo.c b/demos/vulkaninfo.c index 03a4f703..de685b9c 100644 --- a/demos/vulkaninfo.c +++ b/demos/vulkaninfo.c @@ -884,6 +884,13 @@ static void AppCreateXcbWindow(struct AppInstance *inst) { exit(1); } + int conn_error = xcb_connection_has_error(inst->xcb_connection); + if (conn_error) { + printf("XCB failed to connect to the X server due to error:%d.\nExiting ...\n", conn_error); + fflush(stdout); + exit(1); + } + setup = xcb_get_setup(inst->xcb_connection); iter = xcb_setup_roots_iterator(setup); while (scr-- > 0) { |
