Commit 1851e1d0 authored by Martin Storsjö's avatar Martin Storsjö

rtpproto: Check the size before reading buf[1]

I doubt that anyone ever would try to send a 1 byte packet
via the RTP protocol, but check just in case - it shouldn't
crash at least.
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 7748dd41
......@@ -368,6 +368,9 @@ static int rtp_write(URLContext *h, const uint8_t *buf, int size)
int ret;
URLContext *hd;
if (size < 2)
return AVERROR(EINVAL);
if (RTP_PT_IS_RTCP(buf[1])) {
/* RTCP payload type */
hd = s->rtcp_hd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment