diff mbox series

[FFmpeg-devel,4/6] avformat/pp_bnk: Use 64bit in bitrate computation

Message ID 20210425194014.957-4-michael@niedermayer.cc
State Accepted
Commit 88fc295838b3cf16b43c0bbea5766fe92b18dd17
Headers show
Series [FFmpeg-devel,1/6] avformat/subtitles: Check pts difference before use
Related show

Checks

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

Commit Message

Michael Niedermayer April 25, 2021, 7:40 p.m. UTC
Fixes: signed integer overflow: 1207959552 * 4 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_PP_BNK_fuzzer-6747301169201152

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

Patch

diff --git a/libavformat/pp_bnk.c b/libavformat/pp_bnk.c
index 07eeca3cd5..5ffe733b18 100644
--- a/libavformat/pp_bnk.c
+++ b/libavformat/pp_bnk.c
@@ -223,7 +223,7 @@  static int pp_bnk_read_header(AVFormatContext *s)
         par->bits_per_coded_sample  = 4;
         par->bits_per_raw_sample    = 16;
         par->block_align            = 1;
-        par->bit_rate               = par->sample_rate * par->bits_per_coded_sample * par->channels;
+        par->bit_rate               = par->sample_rate * (int64_t)par->bits_per_coded_sample * par->channels;
 
         avpriv_set_pts_info(st, 64, 1, par->sample_rate);
         st->start_time              = 0;