mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
avformat/hls: Check url_offset and size
Fixes: integer overflow
Found-by: jiale yao
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c2047918e6)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -452,6 +452,11 @@ static struct segment *new_init_section(struct playlist *pls,
|
||||
ptr = strchr(info->byterange, '@');
|
||||
if (ptr)
|
||||
sec->url_offset = strtoll(ptr+1, NULL, 10);
|
||||
if (sec->size < 0 || sec->url_offset < 0 || sec->size > INT64_MAX - sec->url_offset) {
|
||||
av_freep(&sec->url);
|
||||
av_free(sec);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
/* the entire file is the init section */
|
||||
sec->size = -1;
|
||||
|
||||
Reference in New Issue
Block a user