mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avformat/hls: Check seg size and offset for overflow
Fixes: integer overflow Fixes: signed integer overflow: 9223372036854775807 + 2039324394 cannot be represented in type 'int64_t' (aka 'long') Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
michaelni
parent
8ac6325143
commit
d1985442e1
@@ -975,6 +975,10 @@ static int parse_playlist(HLSContext *c, const char *url,
|
||||
ptr = strchr(ptr, '@');
|
||||
if (ptr)
|
||||
seg_offset = strtoll(ptr+1, NULL, 10);
|
||||
if (seg_size < 0 || seg_offset > INT64_MAX - seg_size) {
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
} else if (av_strstart(line, "#", NULL)) {
|
||||
av_log(c->ctx, AV_LOG_VERBOSE, "Skip ('%s')\n", line);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user