aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2020-03-21 18:31:06 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-07-07 22:56:34 +0200
commitd18eee412abeb8151079a3c204483a181cacc0d9 (patch)
treed251d84ab30e6b880afdba92244092448fe2c1b6
parentd32a4031021f90f071d6f57c9d24d9e838f63764 (diff)
downloadffmpeg-d18eee412abeb8151079a3c204483a181cacc0d9.tar.gz
avformat/mccdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r--libavformat/mccdec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavformat/mccdec.c b/libavformat/mccdec.c
index 10ed7c0dc1..0bc13ceaa6 100644
--- a/libavformat/mccdec.c
+++ b/libavformat/mccdec.c
@@ -188,7 +188,7 @@ static int mcc_read_header(AVFormatContext *s)
continue;
sub = ff_subtitles_queue_insert(&mcc->q, out + start, count, 0);
if (!sub)
- goto fail;
+ return AVERROR(ENOMEM);
sub->pos = pos;
sub->pts = ts;
@@ -198,9 +198,6 @@ static int mcc_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &mcc->q);
return ret;
-fail:
- ff_subtitles_queue_clean(&mcc->q);
- return AVERROR(ENOMEM);
}
static int mcc_read_packet(AVFormatContext *s, AVPacket *pkt)
@@ -228,6 +225,7 @@ const AVInputFormat ff_mcc_demuxer = {
.name = "mcc",
.long_name = NULL_IF_CONFIG_SMALL("MacCaption"),
.priv_data_size = sizeof(MCCContext),
+ .flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = mcc_probe,
.read_header = mcc_read_header,
.read_packet = mcc_read_packet,