aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Wolenetz <wolenetz@chromium.org>2018-03-05 15:59:18 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2018-03-07 20:37:33 +0100
commitb59b59944693e645cdcf5e61b60f288820fe48c3 (patch)
treeac3ca9237566db7886f9876f45b7e292731d1d27
parent23c91abe4f6a76d0a5066adf2abbf8cd66f1b1ec (diff)
downloadffmpeg-b59b59944693e645cdcf5e61b60f288820fe48c3.tar.gz
lavc/vorbisdec: Allow avcodec_open2 to call .close
If there is a decoder initialization failure detected in avcodec_open2 after .init is called, allow graceful decoder .close to prevent leaking vorbis decoder allocations such as those from vorbis_parse_setup_*. BUG=772699 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vorbisdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 2a4f482031..00e9cd8a13 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -1862,6 +1862,7 @@ AVCodec ff_vorbis_decoder = {
.decode = vorbis_decode_frame,
.flush = vorbis_decode_flush,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.channel_layouts = ff_vorbis_channel_layouts,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },