summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-26 15:37:49 +0100
committerwm4 <wm4@nowhere>2014-10-26 15:42:47 +0100
commitf22acd94aff9c5e24ec87ce9a914cbdb14d5cb7e (patch)
treebf037dd08cef6dd23249513f70c7ba8d83d41ae4
parent078f5f300dc776dd78608fb5c0048cb77e92e6cf (diff)
downloadmpv-f22acd94aff9c5e24ec87ce9a914cbdb14d5cb7e.tar.bz2
mpv-f22acd94aff9c5e24ec87ce9a914cbdb14d5cb7e.tar.xz
dxva2: fix crash on initialization failure
If dxva2_init() fails, dxva2_uninit() will be called twice.
-rw-r--r--video/decode/dxva2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/video/decode/dxva2.c b/video/decode/dxva2.c
index e03014438a..f2a70f099d 100644
--- a/video/decode/dxva2.c
+++ b/video/decode/dxva2.c
@@ -157,6 +157,8 @@ static void dxva2_destroy_decoder(struct lavc_ctx *s)
static void dxva2_uninit(struct lavc_ctx *s)
{
DXVA2Context *ctx = s->hwdec_priv;
+ if (!ctx)
+ return;
if (ctx->decoder)
dxva2_destroy_decoder(s);