summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-07-03 17:41:45 -0700
committerwm4 <wm4@nowhere>2016-12-11 14:20:58 +0100
commit2d9b6ff7cd51c352533e13bb24624c387415dbfb (patch)
treea059937f827c0acba9beb62ade24cf44d0ea6ee4 /audio
parent0aa9b2a46973699ae0eb5aa2f8eed16311bdab2d (diff)
downloadmpv-2d9b6ff7cd51c352533e13bb24624c387415dbfb.tar.bz2
mpv-2d9b6ff7cd51c352533e13bb24624c387415dbfb.tar.xz
ad_spdif: Fix crash when spdif muxer is not available
Currently, if init_filter fails after lavf_ctx is allocated, uninit is called which frees lavf_ctx, but doesn't clear the pointer in spdif_ctx. So, on the next call of decode_packet, it thinks it is already initialized and uses it, resulting in a crash on my system.
Diffstat (limited to 'audio')
-rw-r--r--audio/decode/ad_spdif.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c
index e15aca5c53..60aef3b18f 100644
--- a/audio/decode/ad_spdif.c
+++ b/audio/decode/ad_spdif.c
@@ -71,6 +71,7 @@ static void uninit(struct dec_audio *da)
av_freep(&lavf_ctx->pb->buffer);
av_freep(&lavf_ctx->pb);
avformat_free_context(lavf_ctx);
+ spdif_ctx->lavf_ctx = NULL;
}
}