[FFmpeg-cvslog] avformat/avr: Check sample rate

Michael Niedermayer git at videolan.org
Sun Apr 14 23:23:26 EEST 2024


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jul 23 01:46:20 2023 +0200| [8da2dda09d2772321715cdc72fcadc6bb53805c0] | committer: Michael Niedermayer

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 at outlook.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 32556fa62b1d0615f621fd8f71bdfe3b72e43896)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8da2dda09d2772321715cdc72fcadc6bb53805c0
---

 libavformat/avr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/avr.c b/libavformat/avr.c
index c4ce70142a..a79898f146 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);



More information about the ffmpeg-cvslog mailing list