mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/utils: Check for overflow with ATRAC* in get_audio_frame_duration()
Fixes: signed integer overflow: 1024 * 13129048 cannot be represented in type 'int'
Fixes: 26378/clusterfuzz-testcase-minimized-ffmpeg_dem_CODEC2RAW_fuzzer-5634018353348608
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 01bb12f883
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
85cf812442
commit
6778e41252
@ -1573,7 +1573,10 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
|
||||
case AV_CODEC_ID_MP1: return 384;
|
||||
case AV_CODEC_ID_ATRAC1: return 512;
|
||||
case AV_CODEC_ID_ATRAC9:
|
||||
case AV_CODEC_ID_ATRAC3: return 1024 * framecount;
|
||||
case AV_CODEC_ID_ATRAC3:
|
||||
if (framecount > INT_MAX/1024)
|
||||
return 0;
|
||||
return 1024 * framecount;
|
||||
case AV_CODEC_ID_ATRAC3P: return 2048;
|
||||
case AV_CODEC_ID_MP2:
|
||||
case AV_CODEC_ID_MUSEPACK7: return 1152;
|
||||
|
Loading…
Reference in New Issue
Block a user