mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
omadec: Properly check lengths before incrementing the position
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
a06a5b78e2
commit
342c43d154
@ -172,7 +172,11 @@ static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
|
|||||||
taglen = AV_RB32(&enc_header[pos + 32]);
|
taglen = AV_RB32(&enc_header[pos + 32]);
|
||||||
datalen = AV_RB32(&enc_header[pos + 36]) >> 4;
|
datalen = AV_RB32(&enc_header[pos + 36]) >> 4;
|
||||||
|
|
||||||
pos += 44 + taglen;
|
pos += 44;
|
||||||
|
if (size - pos < taglen)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
pos += taglen;
|
||||||
|
|
||||||
if (datalen << 4 > size - pos)
|
if (datalen << 4 > size - pos)
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user