From 13e14d95e1bd9484c69a9f4fe3409fc5cb9ebaaf Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Tue, 11 Jun 2019 20:51:39 -0700 Subject: 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. --- video/out/opengl/context_wayland.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video/out') diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index 650072c73c..3ce42ad01b 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -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; -- cgit v1.2.3