mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/mvdec: Check sample rate in parse_audio_var()
Fixes: signed integer overflow: -635424002382840000 * 16 cannot be represented in type 'long' Fixes: 33612/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5704741108711424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
08d2df4153
commit
0ff60249a5
|
@ -157,6 +157,8 @@ static int parse_audio_var(AVFormatContext *avctx, AVStream *st,
|
||||||
return set_channels(avctx, st, var_read_int(pb, size));
|
return set_channels(avctx, st, var_read_int(pb, size));
|
||||||
} else if (!strcmp(name, "SAMPLE_RATE")) {
|
} else if (!strcmp(name, "SAMPLE_RATE")) {
|
||||||
st->codecpar->sample_rate = var_read_int(pb, size);
|
st->codecpar->sample_rate = var_read_int(pb, size);
|
||||||
|
if (st->codecpar->sample_rate <= 0)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
avpriv_set_pts_info(st, 33, 1, st->codecpar->sample_rate);
|
avpriv_set_pts_info(st, 33, 1, st->codecpar->sample_rate);
|
||||||
} else if (!strcmp(name, "SAMPLE_WIDTH")) {
|
} else if (!strcmp(name, "SAMPLE_WIDTH")) {
|
||||||
uint64_t bpc = var_read_int(pb, size) * (uint64_t)8;
|
uint64_t bpc = var_read_int(pb, size) * (uint64_t)8;
|
||||||
|
|
Loading…
Reference in New Issue