[FFmpeg-devel] [PATCH 49/54] avformat/vapoursynth: Simplify cleanup after read_header failure

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Jun 16 02:32:38 EEST 2021


by setting the FF_FMT_INIT_CLEANUP flag.

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

diff --git a/libavformat/vapoursynth.c b/libavformat/vapoursynth.c
index 4ec4e77b59..1578a6ac77 100644
--- a/libavformat/vapoursynth.c
+++ b/libavformat/vapoursynth.c
@@ -294,8 +294,6 @@ static av_cold int read_header_vs(AVFormatContext *s)
 
 done:
     av_free(buf);
-    if (err < 0)
-        read_close_vs(s);
     return err;
 }
 
@@ -487,6 +485,7 @@ const AVInputFormat ff_vapoursynth_demuxer = {
     .name           = "vapoursynth",
     .long_name      = NULL_IF_CONFIG_SMALL("VapourSynth demuxer"),
     .priv_data_size = sizeof(VSContext),
+    .flags_internal = FF_FMT_INIT_CLEANUP,
     .read_probe     = probe_vs,
     .read_header    = read_header_vs,
     .read_packet    = read_packet_vs,
-- 
2.27.0



More information about the ffmpeg-devel mailing list