[FFmpeg-cvslog] avcodec/utils: Use more bits for intermediate for AV_CODEC_ID_ADPCM_MS

Michael Niedermayer git at videolan.org
Mon Mar 15 23:29:26 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Feb  1 19:55:03 2021 +0100| [0f441b9063281d8ef5d4c30b10379d08aad8924f] | committer: Michael Niedermayer

avcodec/utils: Use more bits for intermediate for AV_CODEC_ID_ADPCM_MS

Fixes: signed integer overflow: 1172577312 * 2 cannot be represented in type 'int'
Fixes: 29924/clusterfuzz-testcase-minimized-ffmpeg_dem_BOA_fuzzer-4882912874594304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b8a8c0ac2e..66d286565b 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1797,7 +1797,7 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
                 case AV_CODEC_ID_ADPCM_IMA_RAD:
                     return blocks * ((ba - 4 * ch) * 2 / ch);
                 case AV_CODEC_ID_ADPCM_MS:
-                    return blocks * (2 + (ba - 7 * ch) * 2 / ch);
+                    return blocks * (2 + (ba - 7 * ch) * 2LL / ch);
                 case AV_CODEC_ID_ADPCM_MTAF:
                     return blocks * (ba - 16) * 2 / ch;
                 }



More information about the ffmpeg-cvslog mailing list