diff options
author | Michael Forney <mforney@mforney.org> | 2014-07-23 15:33:29 -0700 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-08-04 09:50:24 +0200 |
commit | 618361c6979ed9cce5986e97a8588f69b0ffcea8 (patch) | |
tree | 8db24a41c6a395a7758d3c43c3783760ad2fbe71 | |
parent | 913b49fcbc3774de1ab91ccb1c591eee4c53912d (diff) | |
download | mpv-618361c6979ed9cce5986e97a8588f69b0ffcea8.tar.bz2 mpv-618361c6979ed9cce5986e97a8588f69b0ffcea8.tar.xz |
gl_wayland: Don't try to resize the egl_window before it exists
If the compositor sends a configure event immediately after a window is
created (for example, if it implements tiling window management), mpv
will attempt to call wl_egl_window_resize before it has actually created
the egl_window, causing a crash.
-rw-r--r-- | video/out/gl_wayland.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/video/out/gl_wayland.c b/video/out/gl_wayland.c index 71b1d4270a..ca98a26c63 100644 --- a/video/out/gl_wayland.c +++ b/video/out/gl_wayland.c @@ -26,6 +26,9 @@ static void egl_resize(struct vo_wayland_state *wl) int32_t width = wl->window.sh_width; int32_t height = wl->window.sh_height; + if (!wl->egl_context.egl_window) + return; + // get the real size of the window // this improves moving the window while resizing it wl_egl_window_get_attached_size(wl->egl_context.egl_window, |