diff mbox series

[FFmpeg-devel,47/54] avformat/tedcaptionsdec: Simplify cleanup after read_header failure

Message ID HE1PR0301MB2154B6716E3CA35E76BBB0988F309@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 7ef252b64afa7195e2eba3651559ac19c1a33c73
Headers show
Series [FFmpeg-devel,01/54] avformat: Add internal flags for AV(In|Out)putFormat | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt June 15, 2021, 11:32 p.m. UTC
by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/tedcaptionsdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/tedcaptionsdec.c b/libavformat/tedcaptionsdec.c
index 8bebaba5c0..4bf93e26e2 100644
--- a/libavformat/tedcaptionsdec.c
+++ b/libavformat/tedcaptionsdec.c
@@ -288,7 +288,6 @@  static av_cold int tedcaptions_read_header(AVFormatContext *avf)
         if (ret == AVERROR_INVALIDDATA)
             av_log(avf, AV_LOG_ERROR, "Syntax error near offset %"PRId64".\n",
                    avio_tell(avf->pb));
-        ff_subtitles_queue_clean(&tc->subs);
         return ret;
     }
     ff_subtitles_queue_finalize(avf, &tc->subs);
@@ -358,6 +357,7 @@  const AVInputFormat ff_tedcaptions_demuxer = {
     .name           = "tedcaptions",
     .long_name      = NULL_IF_CONFIG_SMALL("TED Talks captions"),
     .priv_data_size = sizeof(TEDCaptionsDemuxer),
+    .flags_internal = FF_FMT_INIT_CLEANUP,
     .priv_class     = &tedcaptions_demuxer_class,
     .read_header    = tedcaptions_read_header,
     .read_packet    = tedcaptions_read_packet,