diff options
author | Michael Forney <mforney@mforney.org> | 2019-06-11 20:51:39 -0700 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-07-08 01:00:01 +0200 |
commit | 13e14d95e1bd9484c69a9f4fe3409fc5cb9ebaaf (patch) | |
tree | ea40dca32cd6a96bc5e074868c50ef757e077b61 /video/out/opengl | |
parent | e2976e662d9215b5a466b108efc89e19fc718616 (diff) | |
download | mpv-13e14d95e1bd9484c69a9f4fe3409fc5cb9ebaaf.tar.bz2 mpv-13e14d95e1bd9484c69a9f4fe3409fc5cb9ebaaf.tar.xz |
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.
Diffstat (limited to 'video/out/opengl')
-rw-r--r-- | video/out/opengl/context_wayland.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |