mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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>
(cherry picked from commit 1868cb7316
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
d2cefe21e1
commit
0ee0f51886
@ -274,6 +274,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;
|
||||
|
Loading…
Reference in New Issue
Block a user