aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-21 19:37:45 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-09 22:02:19 +0200
commitcf572adb925794fda38dd3b568da3a0c81e4f41f (patch)
tree5ea374301e2dc56237d0c82dd539f1d9c429af38
parent4ecce5f2562a4be683b9321f385b6ac57f48f5a8 (diff)
downloadffmpeg-cf572adb925794fda38dd3b568da3a0c81e4f41f.tar.gz
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 <michael@niedermayer.cc> (cherry picked from commit 44b18a76b8d4e01c7ce62474aaf196857e75e976) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/xwma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/xwma.c b/libavformat/xwma.c
index df84d25331..6e74a338bf 100644
--- a/libavformat/xwma.c
+++ b/libavformat/xwma.c
@@ -186,6 +186,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;
}