diff mbox series

[FFmpeg-devel,09/54] avformat/assdec: Simplify cleanup after read_header failure

Message ID HE1PR0301MB2154E3B11ADBE3F597D11A1A8F309@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit ef7eaa4529b2c536bf0682f05508b98114795ac1
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:31 p.m. UTC
by setting the FF_FMT_INIT_CLEANUP flag.

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

Patch

diff --git a/libavformat/assdec.c b/libavformat/assdec.c
index 4a9650fe76..5f71fcb024 100644
--- a/libavformat/assdec.c
+++ b/libavformat/assdec.c
@@ -160,8 +160,6 @@  static int ass_read_header(AVFormatContext *s)
     ff_subtitles_queue_finalize(s, &ass->q);
 
 end:
-    if (res < 0)
-        ass_read_close(s);
     av_bprint_finalize(&header, NULL);
     av_bprint_finalize(&line,   NULL);
     av_bprint_finalize(&rline,  NULL);
@@ -185,6 +183,7 @@  static int ass_read_seek(AVFormatContext *s, int stream_index,
 const AVInputFormat ff_ass_demuxer = {
     .name           = "ass",
     .long_name      = NULL_IF_CONFIG_SMALL("SSA (SubStation Alpha) subtitle"),
+    .flags_internal = FF_FMT_INIT_CLEANUP,
     .priv_data_size = sizeof(ASSContext),
     .read_probe     = ass_probe,
     .read_header    = ass_read_header,