summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2020-10-21 19:37:45 +0200
committerMichael Niedermayer <[email protected]>2021-09-09 13:53:29 +0200
commitbb88c223d6b414cf939dc8143f41a36da332ab30 (patch)
treeb097eed6564d01b99b460dc84a0ddb0a3f0bbeae
parentc07661c8cd9508d4db1ea8cd408ecc078acc7d0b (diff)
avformat/xwma: Check for EOF in dpds_table read code
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 <[email protected]> (cherry picked from commit 44b18a76b8d4e01c7ce62474aaf196857e75e976) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/xwma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/xwma.c b/libavformat/xwma.c
index f357c3e881..ffe0bb7012 100644
--- a/libavformat/xwma.c
+++ b/libavformat/xwma.c
@@ -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;
}