summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2015-02-09 13:45:44 +0000
committerEric Anholt <eric@anholt.net>2015-03-24 12:43:34 -0700
commit82634d2b69950e7e9a066c8c96bf2624ac26193a (patch)
tree9bf245f1028d678ef1d58ac95c5bbad09803c337 /hw
parent391bcf77db96ff227e504c213aa5d5db09b6a050 (diff)
ephyr: Avoid a segfault with 'DISPLAY= Xephyr -glamor'
ephyr_glamor_connect() returns NULL if we failed, but applying xcb_connection_has_error() to NULL is not permitted. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ephyr/hostx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 506a852b8..c67ff60d3 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -443,7 +443,7 @@ hostx_init(void)
else
#endif
HostX.conn = xcb_connect(NULL, &HostX.screen);
- if (xcb_connection_has_error(HostX.conn)) {
+ if (!HostX.conn || xcb_connection_has_error(HostX.conn)) {
fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n");
exit(1);
}