summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2015-03-22 02:43:12 +0200
committerwm4 <wm4@nowhere>2015-03-23 21:53:32 +0100
commit3f4e154ec659b1f0aa306f179e8d37eea5fe19cc (patch)
tree9b6e265f3cc6aadf07201c4e2d89471f58bef27f
parent3a6ade7a848f5213525430d9049e96e642638fc8 (diff)
downloadmpv-3f4e154ec659b1f0aa306f179e8d37eea5fe19cc.tar.bz2
mpv-3f4e154ec659b1f0aa306f179e8d37eea5fe19cc.tar.xz
vo_wayland: fix null dereference
If compositor sends configure event before back_buffer is allocated, it will cause null dereference.
-rw-r--r--video/out/vo_wayland.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index ab4ed8c9c3..40f06aa7eb 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -268,7 +268,7 @@ static bool resize(struct priv *p)
{
struct vo_wayland_state *wl = p->wl;
- if (SHM_BUFFER_IS_BUSY(p->video_bufpool.back_buffer))
+ if (!p->video_bufpool.back_buffer || SHM_BUFFER_IS_BUSY(p->video_bufpool.back_buffer))
return false; // skip resizing if we can't garantuee pixel perfectness!
int32_t x = wl->window.sh_x;