summaryrefslogtreecommitdiffstats
path: root/video/out
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.xyz>2017-09-22 14:18:08 +0200
committerNiklas Haas <git@haasn.xyz>2017-09-22 14:20:11 +0200
commitd325f30fb591c560744410edb55cd378f2b7b429 (patch)
tree95ddc835b97dafb35b39476b088bbf165ab011cf /video/out
parent0b5c1d29121cef9706008a20cc7756e3cfc40f1e (diff)
downloadmpv-d325f30fb591c560744410edb55cd378f2b7b429.tar.bz2
mpv-d325f30fb591c560744410edb55cd378f2b7b429.tar.xz
vo_opengl_cb: fix segfault on uninit
The code used ra_ctx_destroy even though ra_ctx_create was never called (since it's just a dummy ctx), which led to a conflict of assumptions. The proper fix is to only use ra_gl_ctx_uninit (mirroring the ra_gl_ctx_init) and free the dummy ctx manually. Fixes https://github.com/cmdrkotori/mpc-qt/issues/129
Diffstat (limited to 'video/out')
-rw-r--r--video/out/vo_opengl_cb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c
index 7e95e8bd31..e46f4d6ff7 100644
--- a/video/out/vo_opengl_cb.c
+++ b/video/out/vo_opengl_cb.c
@@ -242,8 +242,10 @@ int mpv_opengl_cb_uninit_gl(struct mpv_opengl_cb_context *ctx)
ctx->hwdec = NULL;
hwdec_devices_destroy(ctx->hwdec_devs);
ctx->hwdec_devs = NULL;
- ra_ctx_destroy(&ctx->ra_ctx);
+ ra_gl_ctx_uninit(ctx->ra_ctx);
+ talloc_free(ctx->ra_ctx);
talloc_free(ctx->gl);
+ ctx->ra_ctx = NULL;
ctx->gl = NULL;
return 0;
}