[FFmpeg-cvslog] avformat/rdt: Check pkt_len
Michael Niedermayer
git at videolan.org
Wed Jul 24 17:49:06 EEST 2024
ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Fri Jun 7 01:50:00 2024 +0200| [0d1f7739046c14d664f0bcc9da3941a7f6d62ffd] | committer: Michael Niedermayer
avformat/rdt: Check pkt_len
Fixes: CID1473553 Untrusted loop bound
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 0d0373de3bc6aa6fa5c71247191afccfaf20723d)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0d1f7739046c14d664f0bcc9da3941a7f6d62ffd
---
libavformat/rdt.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 60c36f09e6..1250c9d70a 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -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;
More information about the ffmpeg-cvslog
mailing list