[FFmpeg-cvslog] avformat/xwma: Check for EOF in dpds_table read code

Michael Niedermayer git at videolan.org
Fri Oct 30 18:51:02 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Oct 21 19:37:45 2020 +0200| [44b18a76b8d4e01c7ce62474aaf196857e75e976] | committer: Michael Niedermayer

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 at niedermayer.cc>

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

 libavformat/xwma.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/xwma.c b/libavformat/xwma.c
index 5a57caa841..aedadcf140 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;
             }



More information about the ffmpeg-cvslog mailing list