From ad3f6d2f9746df18745c609bd268368f7e8d0100 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Sun, 4 Mar 2018 03:53:34 +0100 Subject: 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. --- video/out/opengl/libmpv_gl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 = { -- cgit v1.2.3