[FFmpeg-cvslog] avformat/wavdec: Check for EOF in cues reading

Michael Niedermayer git at videolan.org
Sat Dec 5 01:11:41 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov  1 22:18:49 2020 +0100| [72ca9f38e42169d3d0efdad5fd4019b1abe4f152] | committer: Michael Niedermayer

avformat/wavdec: Check for EOF in cues reading

Fixes: Timeout (>20sec -> 1ms)
Fixes: 26793/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-5674966852567040

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index df6030a42d..67ab620347 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -558,6 +558,9 @@ static int wav_read_header(AVFormatContext *s)
                     for (int i = 0; i < nb_cues; i++) {
                         unsigned offset, id = avio_rl32(pb);
 
+                        if (avio_feof(pb))
+                            return AVERROR_INVALIDDATA;
+
                         avio_skip(pb, 16);
                         offset = avio_rl32(pb);
 



More information about the ffmpeg-cvslog mailing list