mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-02 18:48:27 +00:00
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 2c789f753c
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
fa4fdc7ffb
commit
a9fcab5cdc
@ -253,7 +253,7 @@ static int xwma_read_header(AVFormatContext *s)
|
|||||||
* the total duration using the average bits per sample and the
|
* the total duration using the average bits per sample and the
|
||||||
* total data length.
|
* 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:
|
fail:
|
||||||
|
Loading…
Reference in New Issue
Block a user