diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2020-03-21 18:31:06 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-07-08 12:51:20 +0200 |
commit | 9821217a4f482c98fcf237ed2bfc2b5f8c83a5b5 (patch) | |
tree | f52972c7564cbecfaef625451523ff11c958288f | |
parent | 3237d955e8ed82a8a2340a9e967417120548b076 (diff) | |
download | ffmpeg-9821217a4f482c98fcf237ed2bfc2b5f8c83a5b5.tar.gz |
avformat/mpsubdec: 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/mpsubdec.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c index ee53be17d6..abf0e7fb9a 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -165,9 +165,6 @@ static int mpsub_read_header(AVFormatContext *s) ff_subtitles_queue_finalize(s, &mpsub->q); end: - if (res < 0) - ff_subtitles_queue_clean(&mpsub->q); - av_bprint_finalize(&buf, NULL); return res; } @@ -197,6 +194,7 @@ const AVInputFormat ff_mpsub_demuxer = { .name = "mpsub", .long_name = NULL_IF_CONFIG_SMALL("MPlayer subtitles"), .priv_data_size = sizeof(MPSubContext), + .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = mpsub_probe, .read_header = mpsub_read_header, .read_packet = mpsub_read_packet, |