From 8161ac2902836032b6f6684aa48275325f8ca9ef Mon Sep 17 00:00:00 2001 From: Gyan Doshi Date: Sun, 31 Mar 2019 00:00:50 +0530 Subject: lavf/movenc: fix tmcd writing for non-MP4/MOV modes write_tmcd allows tmcd track to be created with any mode but in mov_write_header, index for first tmcd track is only set for modes MP4 or MOV, causing a crash if tmcd creation is attempted with other modes. --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavformat/movenc.c') diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 7f5dcd703e..c67f909608 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6381,7 +6381,7 @@ static int mov_write_header(AVFormatContext *s) nb_tracks++; } - if (mov->mode == MODE_MOV || mov->mode == MODE_MP4) + if (mov->nb_meta_tmcd) tmcd_track = nb_tracks; for (i = 0; i < s->nb_streams; i++) { -- cgit v1.2.3