[FFmpeg-cvslog] avformat/samidec: Simplify cleanup after read_header failure

Andreas Rheinhardt git at videolan.org
Thu Jul 8 16:45:15 EEST 2021


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Mar 21 18:31:06 2020 +0100| [7ae7d936532924108872f1f6d90d9104603616be] | committer: Andreas Rheinhardt

avformat/samidec: Simplify cleanup after read_header failure

by setting the FF_FMT_INIT_CLEANUP flag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7ae7d936532924108872f1f6d90d9104603616be
---

 libavformat/samidec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/samidec.c b/libavformat/samidec.c
index 8f97cb7331..c23335cf4d 100644
--- a/libavformat/samidec.c
+++ b/libavformat/samidec.c
@@ -115,8 +115,6 @@ static int sami_read_header(AVFormatContext *s)
     ff_subtitles_queue_finalize(s, &sami->q);
 
 end:
-    if (res < 0)
-        ff_subtitles_queue_clean(&sami->q);
     av_bprint_finalize(&buf, NULL);
     return res;
 }
@@ -146,6 +144,7 @@ const AVInputFormat ff_sami_demuxer = {
     .name           = "sami",
     .long_name      = NULL_IF_CONFIG_SMALL("SAMI subtitle format"),
     .priv_data_size = sizeof(SAMIContext),
+    .flags_internal = FF_FMT_INIT_CLEANUP,
     .read_probe     = sami_probe,
     .read_header    = sami_read_header,
     .read_packet    = sami_read_packet,



More information about the ffmpeg-cvslog mailing list