Skip to content
Snippets Groups Projects
Unverified Commit ae5b1998 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2c789f75)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 02402b49
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment