properly strip incoming padded RTP frames (bug #4264)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5652 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
22dd5e0c8d
commit
226b476d7f
1 changed files with 8 additions and 0 deletions
8
rtp.c
8
rtp.c
|
@ -429,6 +429,7 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
|
|||
int version;
|
||||
int payloadtype;
|
||||
int hdrlen = 12;
|
||||
int padding;
|
||||
int mark;
|
||||
int ext;
|
||||
int x;
|
||||
|
@ -482,10 +483,17 @@ struct ast_frame *ast_rtp_read(struct ast_rtp *rtp)
|
|||
return &null_frame;
|
||||
|
||||
payloadtype = (seqno & 0x7f0000) >> 16;
|
||||
padding = seqno & (1 << 29);
|
||||
mark = seqno & (1 << 23);
|
||||
ext = seqno & (1 << 28);
|
||||
seqno &= 0xffff;
|
||||
timestamp = ntohl(rtpheader[1]);
|
||||
|
||||
if (padding) {
|
||||
/* Remove padding bytes */
|
||||
res -= rtp->rawdata[AST_FRIENDLY_OFFSET + res - 1];
|
||||
}
|
||||
|
||||
if (ext) {
|
||||
/* RTP Extension present */
|
||||
hdrlen += 4;
|
||||
|
|
Reference in a new issue