From d325f30fb591c560744410edb55cd378f2b7b429 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 22 Sep 2017 14:18:08 +0200 Subject: 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 --- video/out/vo_opengl_cb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'video') 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; } -- cgit v1.2.3