diff mbox series

[FFmpeg-devel,2/2] avformat/kvag: Fix integer overflow in bitrate computation

Message ID 20201010154127.12792-2-michael@niedermayer.cc
State Accepted
Commit 7ac87a2c34bea97dd87208b1ba7384dfbdea2a04
Headers show
Series [FFmpeg-devel,1/2] Add support for building fuzzer tools for an individual demuxer
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make warning Make failed

Commit Message

Michael Niedermayer Oct. 10, 2020, 3:41 p.m. UTC
Fixes: signed integer overflow: 1077952576 * 4 cannot be represented in type 'int'
Fixes: 26152/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5674758518341632

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/kvag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Oct. 18, 2020, 7:29 p.m. UTC | #1
On Sat, Oct 10, 2020 at 05:41:27PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 1077952576 * 4 cannot be represented in type 'int'
> Fixes: 26152/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5674758518341632
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/kvag.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/kvag.c b/libavformat/kvag.c
index 0a11fc0556..8f641873b9 100644
--- a/libavformat/kvag.c
+++ b/libavformat/kvag.c
@@ -83,7 +83,7 @@  static int kvag_read_header(AVFormatContext *s)
     par->bits_per_raw_sample    = 16;
     par->block_align            = 1;
     par->bit_rate               = par->channels *
-                                  par->sample_rate *
+                                  (uint64_t)par->sample_rate *
                                   par->bits_per_coded_sample;
 
     avpriv_set_pts_info(st, 64, 1, par->sample_rate);