aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2023-07-23 01:46:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2023-08-02 17:31:13 +0200
commit32556fa62b1d0615f621fd8f71bdfe3b72e43896 (patch)
tree10a1952be6e1e5fce5f2166c23ff3b312e4cd79e /libavformat
parent3e97d96e6f239894317fc6eb778b25ce67ce5451 (diff)
downloadffmpeg-32556fa62b1d0615f621fd8f71bdfe3b72e43896.tar.gz
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/ffmpeg Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/avr.c b/libavformat/avr.c
index 1cc4d56bfb..dce977b6ac 100644
--- a/libavformat/avr.c
+++ b/libavformat/avr.c
@@ -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);