mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
0aa9b2a469
commit
2d9b6ff7cd
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue