Skip to content
Snippets Groups Projects
Commit 95d880fa authored by Martin Storsjö's avatar Martin Storsjö
Browse files

rtpproto: Fix the input RTP data format check


Only the upper 2 bits of the first byte are known to be
a fixed value.

The lower bits in the first byte of a RTP packet could be set
if the input is from another RTP packetizers than libavformat's,
but for RTCP packets, they would also be set when sending RTCP RR
packets, triggering false warnings about incorrect input format
to the protocol.

Signed-off-by: default avatarMartin Storsjö <martin@martin.st>
parent d2f1d42b
No related branches found
No related tags found
No related merge requests found
...@@ -411,7 +411,7 @@ static int rtp_write(URLContext *h, const uint8_t *buf, int size) ...@@ -411,7 +411,7 @@ static int rtp_write(URLContext *h, const uint8_t *buf, int size)
if (size < 2) if (size < 2)
return AVERROR(EINVAL); return AVERROR(EINVAL);
if (buf[0] != (RTP_VERSION << 6)) if ((buf[0] & 0xc0) != (RTP_VERSION << 6))
av_log(h, AV_LOG_WARNING, "Data doesn't look like RTP packets, " av_log(h, AV_LOG_WARNING, "Data doesn't look like RTP packets, "
"make sure the RTP muxer is used\n"); "make sure the RTP muxer is used\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment