mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-03 11:07:41 +00:00
avformat/aiffdec: Use av_rescale() for bitrate
Fixes: integer overflow
Fixes: 40313/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-4814761406103552
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 905588df97
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ed968f5290
commit
d2d817eaf2
@ -186,8 +186,10 @@ static int get_aiff_header(AVFormatContext *s, int size,
|
||||
par->block_align = (av_get_bits_per_sample(par->codec_id) * par->channels) >> 3;
|
||||
|
||||
if (aiff->block_duration) {
|
||||
par->bit_rate = (int64_t)par->sample_rate * (par->block_align << 3) /
|
||||
aiff->block_duration;
|
||||
par->bit_rate = av_rescale(par->sample_rate, par->block_align * 8LL,
|
||||
aiff->block_duration);
|
||||
if (par->bit_rate < 0)
|
||||
par->bit_rate = 0;
|
||||
}
|
||||
|
||||
/* Chunk is over */
|
||||
|
Loading…
Reference in New Issue
Block a user