diff mbox series

[FFmpeg-devel] avformat/movenc: don't look at previous track_id as it may not be set

Message ID 20240812021625.799-1-jamrial@gmail.com
State New
Headers show
Series [FFmpeg-devel] avformat/movenc: don't look at previous track_id as it may not be set | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

James Almer Aug. 12, 2024, 2:16 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 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 8d91059081..d20e45cf81 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4952,7 +4952,7 @@  static int mov_setup_track_ids(MOVMuxContext *mov, AVFormatContext *s)
             last_track_id =
             mov->tracks[i].track_id = (mov->tracks[i].st
                                        ? FFMAX(mov->tracks[i].st->index, last_track_id)
-                                       : FFMAX((i ? mov->tracks[i - 1].track_id : i), last_track_id)) + 1;
+                                       : FFMAX(i, last_track_id)) + 1;
         }
     }