]> git.sesse.net Git - ffmpeg/commitdiff
avformat/wavdec: Check for EOF in cues reading
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 1 Nov 2020 21:18:49 +0000 (22:18 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Dec 2020 23:08:33 +0000 (00:08 +0100)
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@niedermayer.cc>
libavformat/wavdec.c

index df6030a42d0a07a10654faa8368f44feda9574cf..67ab620347d352c87000607eafebc26e42073948 100644 (file)
@@ -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);