movenc: Ensure no separate moof written for empty track

track->mdat_buf can be not NULL while the track is still empty if the
last packet write failed.

Signed-off-by: Hu Weiwen <sehuww@mail.scut.edu.cn>
Signed-off-by: Martin Storsjö <martin@martin.st>
pull/364/head
Hu Weiwen 3 years ago committed by Martin Storsjö
parent dbe40478e2
commit 2b77a2f723
  1. 2
      libavformat/movenc.c

@ -5422,7 +5422,7 @@ static int mov_flush_fragment(AVFormatContext *s, int force)
duration = track->start_dts + track->track_duration -
track->cluster[0].dts;
if (mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) {
if (!track->mdat_buf)
if (!track->entry)
continue;
mdat_size = avio_tell(track->mdat_buf);
moof_tracks = i;

Loading…
Cancel
Save