[FFmpeg-cvslog] avcodec/utils: fix 2 integer overflows in get_audio_frame_duration()
Michael Niedermayer
git at videolan.org
Thu Oct 19 14:31:40 EEST 2023
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jun 18 21:00:03 2023 +0200| [3249dc8ebfdfae0b9b57700151f3125b9e7408b7] | committer: Michael Niedermayer
avcodec/utils: fix 2 integer overflows in get_audio_frame_duration()
Fixes: signed integer overflow: 256 * 668003712 cannot be represented in type 'int'
Fixes: 59819/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-4674636538052608
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 a4bf559683a999c8faa408fdd8f29bd28a6a47ea)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3249dc8ebfdfae0b9b57700151f3125b9e7408b7
---
libavcodec/utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b72fb06188..ef5c613855 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -3485,7 +3485,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
if (sr > 0) {
/* calc from sample rate */
if (id == AV_CODEC_ID_TTA)
- return 256 * sr / 245;
+ return 256ll * sr / 245;
if (ch > 0) {
/* calc from sample rate and channels */
More information about the ffmpeg-cvslog
mailing list