]> git.sesse.net Git - ffmpeg/commitdiff
avformat/xwma: Check for EOF in dpds_table read code
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 21 Oct 2020 17:37:45 +0000 (19:37 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 30 Oct 2020 16:46:34 +0000 (17:46 +0100)
Fixes: Timeout (>30 -> 140ms)
Fixes: 26478/clusterfuzz-testcase-minimized-ffmpeg_dem_XWMA_fuzzer-5918147066200064
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/xwma.c

index 5a57caa8411beb2262b20ec91c9acefaaa073856..aedadcf14053dc59a75702fe7ad74abed13f57ef 100644 (file)
@@ -211,6 +211,10 @@ static int xwma_read_header(AVFormatContext *s)
             }
 
             for (i = 0; i < dpds_table_size; ++i) {
+                if (avio_feof(pb)) {
+                    ret = AVERROR_INVALIDDATA;
+                    goto fail;
+                }
                 dpds_table[i] = avio_rl32(pb);
                 size -= 4;
             }