1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/timecode: use 64bit for intermediate for rounding in fps_from_frame_rate()

Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4802790784303104
Fixes: signed integer overflow: 1768972133 + 968491058 cannot be represented in type 'int'

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 3d8d778a68)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-03-26 00:27:39 +01:00
parent d53b763fab
commit e3d7703469
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -171,7 +171,7 @@ static int fps_from_frame_rate(AVRational rate)
{
if (!rate.den || !rate.num)
return -1;
return (rate.num + rate.den/2) / rate.den;
return (rate.num + rate.den/2LL) / rate.den;
}
int av_timecode_check_frame_rate(AVRational rate)