mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avformat/matroskadec: Fix handling of huge default durations
Fixes: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself
Fixes: 33997/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6752039691485184
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 343d950a4a
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1196932f1c
commit
3b6f7601b7
@ -2807,8 +2807,9 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||
|
||||
if (track->default_duration) {
|
||||
int div = track->default_duration <= INT64_MAX ? 1 : 2;
|
||||
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
||||
1000000000, track->default_duration, 30000);
|
||||
1000000000 / div, track->default_duration / div, 30000);
|
||||
#if FF_API_R_FRAME_RATE
|
||||
if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000LL
|
||||
&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5LL)
|
||||
|
Loading…
Reference in New Issue
Block a user