mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/mpeg: Check len in mpegps_probe()
Fixes: CID1473590 Untrusted loop bound
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ca237a841e
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
68d61b4eaf
commit
5136568148
@ -75,6 +75,9 @@ static int mpegps_probe(const AVProbeData *p)
|
||||
int pes = endpes <= i && check_pes(p->buf + i, p->buf + p->buf_size);
|
||||
int pack = check_pack_header(p->buf + i);
|
||||
|
||||
if (len > INT_MAX - i)
|
||||
break;
|
||||
|
||||
if (code == SYSTEM_HEADER_START_CODE)
|
||||
sys++;
|
||||
else if (code == PACK_START_CODE && pack)
|
||||
|
Loading…
Reference in New Issue
Block a user