summaryrefslogtreecommitdiff
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 21:35:49 +0200
commitef7eaa4529b2c536bf0682f05508b98114795ac1 (patch)
tree060163631c908c79a6e650f671a9abdb4f4df9ec
parent0de329e8e892d300e0d16e54ee70269e3d335e56 (diff)
avformat/assdec: 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/assdec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 4a9650fe76..5f71fcb024 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -160,8 +160,6 @@ static int ass_read_header(AVFormatContext *s)
ff_subtitles_queue_finalize(s, &ass->q);
end:
- if (res < 0)
- ass_read_close(s);
av_bprint_finalize(&header, NULL);
av_bprint_finalize(&line, NULL);
av_bprint_finalize(&rline, NULL);
@@ -185,6 +183,7 @@ static int ass_read_seek(AVFormatContext *s, int stream_index,
const AVInputFormat ff_ass_demuxer = {
.name = "ass",
.long_name = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
+ .flags_internal = FF_FMT_INIT_CLEANUP,
.priv_data_size = sizeof(ASSContext),
.read_probe = ass_probe,
.read_header = ass_read_header,