diff mbox series

[FFmpeg-devel,43/54] avformat/srtdec: Simplify cleanup after read_header failure

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

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/srtdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
index fa52b85566..2f8a677b9f 100644
--- a/libavformat/srtdec.c
+++ b/libavformat/srtdec.c
@@ -207,8 +207,6 @@  static int srt_read_header(AVFormatContext *s)
     ff_subtitles_queue_finalize(s, &srt->q);
 
 end:
-    if (res < 0)
-        ff_subtitles_queue_clean(&srt->q);
     av_bprint_finalize(&buf, NULL);
     return res;
 }
@@ -238,6 +236,7 @@  const AVInputFormat ff_srt_demuxer = {
     .name        = "srt",
     .long_name   = NULL_IF_CONFIG_SMALL("SubRip subtitle"),
     .priv_data_size = sizeof(SRTContext),
+    .flags_internal = FF_FMT_INIT_CLEANUP,
     .read_probe  = srt_probe,
     .read_header = srt_read_header,
     .read_packet = srt_read_packet,