diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-28 16:45:03 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-12-28 16:45:03 +0000 |
commit | 9bf9545521abbac2a94717447f184c2c9a8f9f4e (patch) | |
tree | e853f63d2f8a7c6074577548d23f45bf6a3579dc /rtp.c | |
parent | 13ef33e7fd72f58fac2504dfd8c1813f36f5b580 (diff) |
Ignore invalid RTP packets (bug #3030)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4570 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'rtp.c')
-rwxr-xr-x | rtp.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -427,6 +427,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) struct sockaddr_in sin; int len; unsigned int seqno; + int version; int payloadtype; int hdrlen = 12; int mark; @@ -477,6 +478,12 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp) /* Get fields */ seqno = ntohl(rtpheader[0]); + + /* Check RTP version */ + version = (seqno & 0xC0000000) >> 30; + if (version != 2) + return &null_frame; + payloadtype = (seqno & 0x7f0000) >> 16; mark = seqno & (1 << 23); ext = seqno & (1 << 28); |