summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-07-21 16:07:15 +0200
committerwm4 <wm4@nowhere>2016-07-21 16:07:15 +0200
commit99d9921f39706b90b00d5b97d07ed12c60ea5786 (patch)
treebf5da6ebedbda25933f406e783d895023d00c3ef
parent16d276308acb88c607d832f743d7d75d8bf9e420 (diff)
downloadmpv-99d9921f39706b90b00d5b97d07ed12c60ea5786.tar.bz2
mpv-99d9921f39706b90b00d5b97d07ed12c60ea5786.tar.xz
vo_opengl: glctx can be NULL during init
This fixes a crash that can happen with the Cocoa backend: it calls vo_wakeup() during init, which calls vo_opengl.c/wakeup(). Fixes #3360.
-rw-r--r--video/out/vo_opengl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 8c8da4affd..8a7c797ea8 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -360,7 +360,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
static void wakeup(struct vo *vo)
{
struct gl_priv *p = vo->priv;
- if (p->glctx->driver->wakeup)
+ if (p->glctx && p->glctx->driver->wakeup)
p->glctx->driver->wakeup(p->glctx);
}