avformat/webm_chunk: Close IO if writing header fails

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 2a78968849)
This commit is contained in:
Andreas Rheinhardt 2020-02-29 21:00:17 +01:00
parent c70f788836
commit 60d8a54432
1 changed files with 1 additions and 1 deletions

View File

@ -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);