diff mbox series

[FFmpeg-devel,28/54] avformat/mpsubdec: Simplify cleanup after read_header failure

Message ID HE1PR0301MB2154F6858C1FE9B4071AB19A8F309@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 9821217a4f482c98fcf237ed2bfc2b5f8c83a5b5
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/mpsubdec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

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,