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:
Michael Forney 2016-07-03 17:41:45 -07:00 committed by wm4
parent 0aa9b2a469
commit 2d9b6ff7cd
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}
}