mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-17 10:30:38 +02:00
egl/x11: don't crash if dri2_dpy->conn is NULL
The dri3 version of commits60e9c35b3aand6de9a03bed. While using xcb_connect() guarantees that we always get a non NULL return value, XGetXCBConnection() does/can not. CC: <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric@engestrom.ch> (cherry picked from commitb10c05d4ff)
This commit is contained in:
parent
32a469b8ed
commit
866aee0264
1 changed files with 5 additions and 9 deletions
|
|
@ -1303,15 +1303,13 @@ dri2_initialize_x11_dri3(_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, "DRI3: xcb_connect failed");
|
||||
goto cleanup_dpy;
|
||||
}
|
||||
|
||||
if (dri2_dpy->conn) {
|
||||
if (!dri3_x11_connect(dri2_dpy))
|
||||
goto cleanup_conn;
|
||||
}
|
||||
if (!dri3_x11_connect(dri2_dpy))
|
||||
goto cleanup_conn;
|
||||
|
||||
if (!dri2_load_driver_dri3(disp))
|
||||
goto cleanup_conn;
|
||||
|
|
@ -1339,10 +1337,8 @@ dri2_initialize_x11_dri3(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
disp->Extensions.WL_bind_wayland_display = EGL_TRUE;
|
||||
#endif
|
||||
|
||||
if (dri2_dpy->conn) {
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, false))
|
||||
goto cleanup_configs;
|
||||
}
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp, false))
|
||||
goto cleanup_configs;
|
||||
|
||||
dri2_dpy->loader_dri3_ext.core = dri2_dpy->core;
|
||||
dri2_dpy->loader_dri3_ext.image_driver = dri2_dpy->image_driver;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue