[FFmpeg-cvslog] avformat/spdifdec: Use 64bit to compute bit rate

Michael Niedermayer git at videolan.org
Wed Oct 12 15:47:20 EEST 2022


ffmpeg | branch: release/3.4 | Michael Niedermayer <michael at niedermayer.cc> | Sun Sep 18 18:12:11 2022 +0200| [c825c20c4f0d1b22c2423f847031fff6bf24cf9d] | committer: Michael Niedermayer

avformat/spdifdec: Use 64bit to compute bit rate

Fixes: signed integer overflow: 32 * 553590816 cannot be represented in type 'int'
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6564974517944320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 4075f0cec1830a7ac081b1a23bd3f5c4e266fe26)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c825c20c4f0d1b22c2423f847031fff6bf24cf9d
---

 libavformat/spdifdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c
index f7288376f6..adc7b138d2 100644
--- a/libavformat/spdifdec.c
+++ b/libavformat/spdifdec.c
@@ -225,7 +225,7 @@ int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
     if (!s->bit_rate && s->streams[0]->codecpar->sample_rate)
         /* stream bitrate matches 16-bit stereo PCM bitrate for currently
            supported codecs */
-        s->bit_rate = 2 * 16 * s->streams[0]->codecpar->sample_rate;
+        s->bit_rate = 2 * 16LL * s->streams[0]->codecpar->sample_rate;
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list