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

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


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

avformat/vapoursynth: 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=c1141aa71a0381c2ec9667ee146e67fa690d04b4
---

 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,



More information about the ffmpeg-cvslog mailing list