1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/rdt: Check pkt_len

Fixes: CID1473553 Untrusted loop bound

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0d0373de3b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-07 01:50:00 +02:00
parent 9c52069b83
commit 807b53c191
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -204,6 +204,8 @@ ff_rdt_parse_header(const uint8_t *buf, int len,
return -1; /* not followed by a data packet */
pkt_len = AV_RB16(buf+3);
if (pkt_len > len)
return AVERROR_INVALIDDATA;
buf += pkt_len;
len -= pkt_len;
consumed += pkt_len;