summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/platform_x11.c
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2015-08-07 19:20:48 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2015-08-07 19:22:27 +0100
commit6de9a03bed400fca5672ef0c13c0039bbe94a679 (patch)
treef56b0057cc86fd82cefcba4e355417079ee2b56a /src/egl/drivers/dri2/platform_x11.c
parent2c7b6cf512a775a37677b1e467d2af952c449dae (diff)
downloadexternal_mesa3d-6de9a03bed400fca5672ef0c13c0039bbe94a679.zip
external_mesa3d-6de9a03bed400fca5672ef0c13c0039bbe94a679.tar.gz
external_mesa3d-6de9a03bed400fca5672ef0c13c0039bbe94a679.tar.bz2
egl/x11: don't crash if dri2_dpy->conn is NULL
Identical to commit 60e9c35b3a0(egl/x11: bail out if we cannot fetch the xcb connection) but for the swrast codepath. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_x11.c')
-rw-r--r--src/egl/drivers/dri2/platform_x11.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index df08a8a..61e5b77 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -1124,7 +1124,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->screen = DefaultScreen(dpy);
}
- if (xcb_connection_has_error(dri2_dpy->conn)) {
+ if (!dri2_dpy->conn || xcb_connection_has_error(dri2_dpy->conn)) {
_eglLog(_EGL_WARNING, "DRI2: xcb_connect failed");
goto cleanup_dpy;
}
@@ -1150,10 +1150,8 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
if (!dri2_create_screen(disp))
goto cleanup_driver;
- if (dri2_dpy->conn) {
- if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
- goto cleanup_configs;
- }
+ if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
+ goto cleanup_configs;
/* Fill vtbl last to prevent accidentally calling virtual function during
* initialization.