mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
ignore invalid rtp packets (bug #3030)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@4606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
7
rtp.c
7
rtp.c
@@ -406,6 +406,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;
|
||||
@@ -454,6 +455,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);
|
||||
|
Reference in New Issue
Block a user