From 1d2d649281ce4db792c40c2dd0ccf4b043a486f3 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 1 Nov 2015 22:55:43 +0100 Subject: vdpau: fix uninit when init fails The uninit() function was called twice if the uninit() function failed (once by init(), once by vd_lavc.c code), which caused crashes due to double-free. (This failure is a corner case, and all other hwdec backends appear to handle this case gracefully.) I do not think this code should be able to deal with uninit() being called other than once. Guarantee that it's called exactly once. --- video/decode/vdpau.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'video/decode/vdpau.c') diff --git a/video/decode/vdpau.c b/video/decode/vdpau.c index 9a3e7e27cf..f8375532fb 100644 --- a/video/decode/vdpau.c +++ b/video/decode/vdpau.c @@ -80,13 +80,9 @@ static int init(struct lavc_ctx *ctx) ctx->hwdec_priv = p; if (mp_vdpau_handle_preemption(p->mpvdp, &p->preemption_counter) < 1) - goto error; + return -1; return 0; - -error: - uninit(ctx); - return -1; } static int probe(struct vd_lavc_hwdec *hwdec, struct mp_hwdec_info *info, -- cgit v1.2.3