aboutsummaryrefslogtreecommitdiffhomepage
path: root/video/out
diff options
context:
space:
mode:
authorGravatar Niklas Haas <git@haasn.xyz>2018-03-04 03:53:34 +0100
committerGravatar Kevin Mitchell <kevmitch@gmail.com>2018-03-04 00:17:00 -0800
commitad3f6d2f9746df18745c609bd268368f7e8d0100 (patch)
treebf10161333546aae32dc05c445b6db5a12d97e5b /video/out
parent79f82a2ca4ed9e1327dc5d4a412af6271adccbb6 (diff)
vo_gpu: don't segfault in libmpv_gl's destroy()
This segfaults when the GPU context has not been fully initialized, such as would be the case when initialization errors.
Diffstat (limited to 'video/out')
-rw-r--r--video/out/opengl/libmpv_gl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/opengl/libmpv_gl.c b/video/out/opengl/libmpv_gl.c
index fc22c67053..5278d6f51a 100644
--- a/video/out/opengl/libmpv_gl.c
+++ b/video/out/opengl/libmpv_gl.c
@@ -101,7 +101,8 @@ static void destroy(struct libmpv_gpu_context *ctx)
{
struct priv *p = ctx->priv;
- ra_gl_ctx_uninit(p->ra_ctx);
+ if (p->ra_ctx)
+ ra_gl_ctx_uninit(p->ra_ctx);
}
const struct libmpv_gpu_context_fns libmpv_gpu_context_gl = {