Commit a3d790f1 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/genh: Check sample rate

Fixes: signed integer overflow: -2515507630940093440 * 4 cannot be represented in type 'long'
Fixes: 46318/clusterfuzz-testcase-minimized-ffmpeg_dem_GENH_fuzzer-5009637474172928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 6007d568
......@@ -67,6 +67,9 @@ static int genh_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
st->codecpar->block_align = align * st->codecpar->ch_layout.nb_channels;
st->codecpar->sample_rate = avio_rl32(s->pb);
if (st->codecpar->sample_rate < 0)
return AVERROR_INVALIDDATA;
avio_skip(s->pb, 4);
st->duration = avio_rl32(s->pb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment