[FFmpeg-cvslog] avformat/webm_chunk: Close IO if writing header fails

Andreas Rheinhardt git at videolan.org
Wed May 20 08:39:22 EEST 2020


ffmpeg | branch: release/4.2 | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sat Feb 29 21:00:17 2020 +0100| [60d8a54432ff28e10a5526b66e2e6a41a04425fd] | committer: Andreas Rheinhardt

avformat/webm_chunk: Close IO if writing header fails

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
(cherry picked from commit 2a789688498b0715e4804ae2b7e36bee0cd65a63)

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

 libavformat/webm_chunk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index 4e2ce21a79..d00ffd284b 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -151,9 +151,9 @@ static int webm_chunk_write_header(AVFormatContext *s)
 
     oc->pb->seekable = 0;
     ret = oc->oformat->write_header(oc);
+    ff_format_io_close(s, &oc->pb);
     if (ret < 0)
         return ret;
-    ff_format_io_close(s, &oc->pb);
     for (i = 0; i < s->nb_streams; i++) {
         // ms precision is the de-facto standard timescale for mkv files.
         avpriv_set_pts_info(s->streams[i], 64, 1, 1000);



More information about the ffmpeg-cvslog mailing list