1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avformat/msf: Check that channels doesnt overflow during extradata construction

Fixes: signed integer overflow: 2048 * 1122336 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MSF_fuzzer-6726959600107520

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:
Michael Niedermayer 2021-04-25 19:54:19 +02:00
parent e7a990164f
commit a1a277926b

View File

@ -70,6 +70,8 @@ static int msf_read_header(AVFormatContext *s)
case 4:
case 5:
case 6: st->codecpar->block_align = (codec == 4 ? 96 : codec == 5 ? 152 : 192) * st->codecpar->channels;
if (st->codecpar->channels > UINT16_MAX / 2048)
return AVERROR_INVALIDDATA;
ret = ff_alloc_extradata(st->codecpar, 14);
if (ret < 0)
return ret;