avformat/avr: Check sample rate

Fixes: 54979/clusterfuzz-testcase-minimized-ffmpeg_dem_AVR_fuzzer-6681035461230592
Fixes: Timeout

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegReviewed-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3e97d96e
......@@ -70,6 +70,9 @@ static int avr_read_header(AVFormatContext *s)
avio_skip(s->pb, 1); // replay speed
st->codecpar->sample_rate = avio_rb24(s->pb);
if (st->codecpar->sample_rate == 0)
return AVERROR_INVALIDDATA;
avio_skip(s->pb, 4 * 3);
avio_skip(s->pb, 2 * 3);
avio_skip(s->pb, 20);
......
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