opengl/context_wayland: Fix crash on configure before initial reconfig

If the compositor sends a configure event before the surface is initially
mapped, resize gets called before the egl_window gets created, resulting
in a crash in wl_egl_window_resize.

This was fixed back in 618361c697, but was reintroduced when the wayland
code was rewritten in 68f9ee7e0b.
This commit is contained in:
Michael Forney 2019-06-11 20:51:39 -07:00 committed by sfan5
parent e2976e662d
commit 13e14d95e1
1 changed files with 3 additions and 1 deletions

View File

@ -45,7 +45,9 @@ static void resize(struct ra_ctx *ctx)
const int32_t height = wl->scaling*mp_rect_h(wl->geometry);
wl_surface_set_buffer_scale(wl->surface, wl->scaling);
wl_egl_window_resize(p->egl_window, width, height, 0, 0);
if (p->egl_window)
wl_egl_window_resize(p->egl_window, width, height, 0, 0);
wl->vo->dwidth = width;
wl->vo->dheight = height;