diff mbox series

[FFmpeg-devel,v3,3/4] avformat/movenc: check track start_dts before use it

Message ID tencent_4C6B9A1C40F19A919F39AB344E6D70062D08@qq.com
State New
Headers show
Series [FFmpeg-devel,v3,1/4] avformat/movenc: fix assert failure in get_cluster_duration() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc fail Make fate failed

Commit Message

zhilizhao(赵志立) Dec. 31, 2021, 11:36 a.m. UTC
---
 libavformat/movenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 9b3bd99e97..faae684fdb 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5465,7 +5465,7 @@  static int mov_flush_fragment(AVFormatContext *s, int force)
     // tracks may need to be filled in.
     for (i = 0; i < s->nb_streams; i++) {
         MOVTrack *track = &mov->tracks[i];
-        if (!track->end_reliable) {
+        if (!track->end_reliable && track->start_dts != AV_NOPTS_VALUE) {
             const AVPacket *pkt = ff_interleaved_peek(s, i);
             if (pkt) {
                 int64_t offset, dts, pts, duration;