diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 3646994c43..53e3772c61 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -5304,6 +5304,7 @@ static int mov_write_header(AVFormatContext *s) !(mov->flags & FF_MOV_FLAG_DELAY_MOOV)) { if ((ret = mov_write_moov_tag(pb, mov, s)) < 0) return ret; + avio_flush(pb); mov->moov_written = 1; if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX) mov->reserved_header_pos = avio_tell(pb);