Message ID | 20211030223053.32745-3-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 905588df975071c03c00b2e923c311b4de65a8f4 |
Headers | show |
Series | [FFmpeg-devel,1/3] avformat/aiffdec: Check sample_rate | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
andriy/make_ppc | success | Make finished |
andriy/make_fate_ppc | success | Make fate finished |
lgtm
On Sun, Oct 31, 2021 at 10:03:17AM +0100, Paul B Mahol wrote:
> lgtm
will apply
thx
[...]
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 648f231a523..7a995c00a66 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -185,8 +185,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 */
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 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/aiffdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)