mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-16 04:11:12 +00:00
avcodec/speexdec: Check frames_per_packet more completely
Fixes: signed integer overflow: 2105344 * 539033345 cannot be represented in type 'int' Fixes: out of array write Fixes: 39956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-4766419250708480 Fixes: 40293/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-5219910217760768 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
74e49cc583
commit
866ad2e952
@ -1423,7 +1423,9 @@ static int parse_speex_extradata(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->vbr = bytestream_get_le32(&buf);
|
||||
s->frames_per_packet = bytestream_get_le32(&buf);
|
||||
if (s->frames_per_packet <= 0)
|
||||
if (s->frames_per_packet <= 0 ||
|
||||
s->frames_per_packet > 64 ||
|
||||
s->frames_per_packet >= INT32_MAX / s->nb_channels / s->frame_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->extra_headers = bytestream_get_le32(&buf);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user