diff mbox series

[FFmpeg-devel,06/17] avformat/webm_chunk: Close IO if writing header fails

Message ID 20200302044445.14842-2-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/17] avformat: Use correct error in case muxer is not found | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt March 2, 2020, 4:44 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/webm_chunk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index 0d4e3598ed..d42f46aab2 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -150,9 +150,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);