summaryrefslogtreecommitdiff
path: root/libavformat
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-08 15:19:55 +0200
commitf545155eb3e6c9fb93548e0233076f2e333e3bec (patch)
treec9e886714166b311a23a20fcf354492a95d7de90 /libavformat
parentd6d113e454c65247449ed509cf15b45dd8a207d0 (diff)
avformat/webvttdec: Simplify cleanup after read_header failure
by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/webvttdec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index a4654034ac..52320ba7d1 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -164,8 +164,6 @@ static int webvtt_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &webvtt->q);
end:
- if (res < 0)
- ff_subtitles_queue_clean(&webvtt->q);
av_bprint_finalize(&cue, NULL);
return res;
}
@@ -214,6 +212,7 @@ const AVInputFormat ff_webvtt_demuxer = {
.name = "webvtt",
.long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
.priv_data_size = sizeof(WebVTTContext),
+ .flags_internal = FF_FMT_INIT_CLEANUP,
.read_probe = webvtt_probe,
.read_header = webvtt_read_header,
.read_packet = webvtt_read_packet,