diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-19 17:59:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-10-21 17:21:41 +0200 |
commit | 1868cb731660490beb750389266adb6e68e9123d (patch) | |
tree | edefb804cdbb414f3c1969b41a74f94f1bf80d8f /libavformat/wtvdec.c | |
parent | a9271286171e069daea4726274a36a94e3f77d03 (diff) | |
download | ffmpeg-1868cb731660490beb750389266adb6e68e9123d.tar.gz |
avformat/wtvdec: Check dir_length
Fixes: Infinite loop
Fixes: 26445/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5125558331244544
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r-- | libavformat/wtvdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 83f510b92f..77908e6392 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -273,6 +273,11 @@ static AVIOContext * wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int b "bad filename length, remaining directory entries ignored\n"); break; } + if (dir_length == 0) { + av_log(s, AV_LOG_ERROR, + "bad dir length, remaining directory entries ignored\n"); + break; + } if (48 + (int64_t)name_size > buf_end - buf) { av_log(s, AV_LOG_ERROR, "filename exceeds buffer size; remaining directory entries ignored\n"); break; |