diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-09-18 16:45:30 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-09 21:33:10 +0200 |
commit | caa009a3fb518ab36cd780798230cd32d33f89b0 (patch) | |
tree | c25fbfbdac3ef661d280d92fab56162fbffaef81 | |
parent | 3f283529f78b974962a867842df8d884b32d9c9e (diff) | |
download | ffmpeg-caa009a3fb518ab36cd780798230cd32d33f89b0.tar.gz |
avformat/xwma: Use av_rescale() for duration computation
Fixes: signed integer overflow: 34242363648 * 538976288 cannot be represented in type 'long'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6577923913547776
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 2c789f753c3657be9041307f9c03749f5ba5a6bb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/xwma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/xwma.c b/libavformat/xwma.c index 29f4c2be18..e37c16b6df 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -278,7 +278,7 @@ static int xwma_read_header(AVFormatContext *s) * the total duration using the average bits per sample and the * total data length. */ - st->duration = (size<<3) * st->codecpar->sample_rate / st->codecpar->bit_rate; + st->duration = av_rescale((size<<3), st->codecpar->sample_rate, st->codecpar->bit_rate); } fail: |