You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-19 19:03:00 +02:00
avformat/movenc: initialize all tracks
Fixes: NULL pointer dereference
As a sideeffect this also sets the timescale correctly if an
intermediate matches MOV_TIMESCALE_Q, the previous code stoped
in that case as it could not distinguish it from the overflow detection
Regression since: 51f5f60443
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
James Almer
parent
dd6ae3e024
commit
c098b07035
@@ -8429,10 +8429,11 @@ static int mov_init(AVFormatContext *s)
|
||||
track->par = st->codecpar;
|
||||
}
|
||||
|
||||
movie_timescale = av_gcd_q(movie_timescale, st->time_base, INT_MAX, MOV_TIMESCALE_Q);
|
||||
if (!av_cmp_q(movie_timescale, MOV_TIMESCALE_Q))
|
||||
break;
|
||||
movie_timescale = av_gcd_q(movie_timescale, st->time_base, INT_MAX, (AVRational){1,0});
|
||||
}
|
||||
if (!movie_timescale.den)
|
||||
movie_timescale = MOV_TIMESCALE_Q;
|
||||
|
||||
if (!mov->movie_timescale)
|
||||
mov->movie_timescale = FFMAX(movie_timescale.den, MOV_TIMESCALE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user