summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-08-01 21:08:20 +0100
committerwm4 <wm4@nowhere>2016-08-01 22:16:40 +0200
commitdea738a245855d93bb21c366747f494f6513a299 (patch)
tree917fd1a9638ab8beb7c8676a96d84169ec36747e /video/out/wayland_common.c
parent251299da4f32095da6c406967cb32d7028d2c841 (diff)
downloadmpv-dea738a245855d93bb21c366747f494f6513a299.tar.bz2
mpv-dea738a245855d93bb21c366747f494f6513a299.tar.xz
wayland_common: check for NULL current_output on fs switching
Prevents segfaults when a fullscreen switch is issued before fully initializing the VO. Doesn't change anything since the schedule_resize is only there to resize in case the image size switches, which happens long after init.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r--video/out/wayland_common.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c
index dbf614e516..d4b7a1eecc 100644
--- a/video/out/wayland_common.c
+++ b/video/out/wayland_common.c
@@ -974,8 +974,9 @@ static void vo_wayland_fullscreen(struct vo *vo)
wl->window.is_fullscreen = true;
wl->window.p_width = wl->window.width;
wl->window.p_height = wl->window.height;
- schedule_resize(wl, 0, wl->display.current_output->width,
- wl->display.current_output->height);
+ if (wl->display.current_output)
+ schedule_resize(wl, 0, wl->display.current_output->width,
+ wl->display.current_output->height);
wl_shell_surface_set_fullscreen(wl->window.shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
0, fs_output);