mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-04 06:30:49 +00:00
avformat/oggparsevorbis.c: Prevent integer overflow when summing header lengths; add bounds check.
Cherry-picked from 6e0e13b0bf
Signed-off-by: Romain Beauxis <romain.beauxis@gmail.com>
This commit is contained in:
parent
d0f9f7a27b
commit
fc265ebb9e
1 changed files with 4 additions and 1 deletions
|
|
@ -223,8 +223,11 @@ static int fixup_vorbis_headers(AVFormatContext *as,
|
|||
int i, offset, len, err;
|
||||
int buf_len;
|
||||
unsigned char *ptr;
|
||||
uint64_t total_len = (uint64_t)priv->len[0] + priv->len[1] + priv->len[2];
|
||||
if (total_len + total_len / 255 + 64 > INT_MAX)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
len = priv->len[0] + priv->len[1] + priv->len[2];
|
||||
len = total_len;
|
||||
buf_len = len + len / 255 + 64;
|
||||
|
||||
if (*buf)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue