mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avcodec/vmdaudio: Check chunk counts to avoid integer overflow
Fixes: signed integer overflow: 4 * 538976288 cannot be represented in type 'int'
Fixes: 18622/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-5092166174507008
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 47d963335e
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3b8512ae09
commit
600e1df9a5
@ -179,6 +179,9 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data,
|
||||
/* drop incomplete chunks */
|
||||
buf_size = audio_chunks * s->chunk_size;
|
||||
|
||||
if (silent_chunks + audio_chunks >= INT_MAX / avctx->block_align)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = ((silent_chunks + audio_chunks) * avctx->block_align) /
|
||||
avctx->channels;
|
||||
|
Loading…
Reference in New Issue
Block a user