diff mbox series

[FFmpeg-devel,37/54] avformat/realtextdec: Simplify cleanup after read_header failure

Message ID HE1PR0301MB2154F5746E1944DF379C4F8B8F309@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 5a58e582159da9286b227eb27537c44c9a6ed233
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/realtextdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c
index 22fc58bc99..f3876d4068 100644
--- a/libavformat/realtextdec.c
+++ b/libavformat/realtextdec.c
@@ -123,8 +123,6 @@  static int realtext_read_header(AVFormatContext *s)
 
 end:
     av_bprint_finalize(&buf, NULL);
-    if (res < 0)
-        ff_subtitles_queue_clean(&rt->q);
     return res;
 }
 
@@ -153,6 +151,7 @@  const AVInputFormat ff_realtext_demuxer = {
     .name           = "realtext",
     .long_name      = NULL_IF_CONFIG_SMALL("RealText subtitle format"),
     .priv_data_size = sizeof(RealTextContext),
+    .flags_internal = FF_FMT_INIT_CLEANUP,
     .read_probe     = realtext_probe,
     .read_header    = realtext_read_header,
     .read_packet    = realtext_read_packet,