Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-09-18 17:45:30 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-24 23:56:22 +0300
commit989f56371d9de82ac1d98e5c0453cecb0b0b0cce (patch)
treef266a45e9754e18ee11e6d72427380ed50152ec3
parent136189522975e252d303cf9fb9e86bb19a5fe709 (diff)
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/xwma.c b/libavformat/xwma.c
index 0f0e3fc8ea..8e0f59fab1 100644
--- a/libavformat/xwma.c
+++ b/libavformat/xwma.c
@@ -254,7 +254,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: