diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-13 20:12:41 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-02 19:41:48 +0100 |
commit | 332a03042dc6fc9a06c4a9c41e2a4bb2e95aa160 (patch) | |
tree | 43b76edee72b2bd2d3b9a519f706329022c997fb | |
parent | f2d81316e8eae5bacc07ed31940ded95b677ca4a (diff) | |
download | ffmpeg-332a03042dc6fc9a06c4a9c41e2a4bb2e95aa160.tar.gz |
avformat/xmv: Make bitrate 64bit
Fixes: signed integer overflow: 32 * 538976288 cannot be represented in type 'int'
Fixes: 15633/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5752273981931520
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 39a6a79bcbe3c2d239ed207a34c5fb3ca7bfdaf0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/xmv.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/xmv.c b/libavformat/xmv.c index 14d007a3e0..bd5962cb94 100644 --- a/libavformat/xmv.c +++ b/libavformat/xmv.c @@ -77,7 +77,7 @@ typedef struct XMVAudioPacket { uint16_t channels; ///< Number of channels. uint32_t sample_rate; ///< Sampling rate. uint16_t bits_per_sample; ///< Bits per compressed sample. - uint32_t bit_rate; ///< Bits of compressed data per second. + uint64_t bit_rate; ///< Bits of compressed data per second. uint16_t flags; ///< Flags unsigned block_align; ///< Bytes per compressed block. uint16_t block_samples; ///< Decompressed samples per compressed block. @@ -198,7 +198,7 @@ static int xmv_read_header(AVFormatContext *s) packet->bits_per_sample = avio_rl16(pb); packet->flags = avio_rl16(pb); - packet->bit_rate = packet->bits_per_sample * + packet->bit_rate = (uint64_t)packet->bits_per_sample * packet->sample_rate * packet->channels; packet->block_align = XMV_BLOCK_ALIGN_SIZE * packet->channels; |