mirror of
https://github.com/librempeg/librempeg
synced 2024-11-23 11:39:47 +00:00
wtvdec: fix name_size check to consider integer overflows.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
83c7803f55
commit
c42efad3c3
@ -258,7 +258,7 @@ static AVIOContext * wtvfile_open2(AVFormatContext *s, const uint8_t *buf, int b
|
||||
dir_length = AV_RL16(buf + 16);
|
||||
file_length = AV_RL64(buf + 24);
|
||||
name_size = 2 * AV_RL32(buf + 32);
|
||||
if (buf + 48 + name_size > buf_end) {
|
||||
if (buf + 48 + (int64_t)name_size > buf_end || name_size<0) {
|
||||
av_log(s, AV_LOG_ERROR, "filename exceeds buffer size; remaining directory entries ignored\n");
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user