summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-09-06 09:41:28 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-09-06 09:41:28 -0500
commit63102d9632219865300a60f343e9b08d6c72ef93 (patch)
tree2c114056a79a60d76adabe8171a345134c8fcff2
parentc5bc2558d7c44b7da9b62705cbe028447cdd098b (diff)
parent6d8c40659f6ad771ec105e225f411d1d5436321d (diff)
Merge "res_rtp_asterisk.c: Check RTP packet version earlier." into 14
-rw-r--r--res/res_rtp_asterisk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index fa0baf21a..acc61c7e5 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -5069,6 +5069,11 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
return &ast_null_frame;
}
+ /* If the version is not what we expected by this point then just drop the packet */
+ if (version != 2) {
+ return &ast_null_frame;
+ }
+
/* If strict RTP protection is enabled see if we need to learn the remote address or if we need to drop the packet */
if (rtp->strict_rtp_state == STRICT_RTP_LEARN) {
if (!ast_sockaddr_cmp(&rtp->strict_rtp_address, &addr)) {
@@ -5115,11 +5120,6 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
}
}
- /* If the version is not what we expected by this point then just drop the packet */
- if (version != 2) {
- return &ast_null_frame;
- }
-
/* Pull out the various other fields we will need */
payloadtype = (seqno & 0x7f0000) >> 16;
padding = seqno & (1 << 29);