summaryrefslogtreecommitdiff
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2013-10-22 23:10:22 +0000
committerMatthew Jordan <mjordan@digium.com>2013-10-22 23:10:22 +0000
commitf04a4328d823059b4d8c2abca732d4cdeb22a04f (patch)
tree0e3f76586ec828316876d769e0b6eb80724b9673 /res/res_rtp_asterisk.c
parent4ae7a4b1bad98840171ab374aede43b16c9ac89b (diff)
res_rtp_asterisk: Fix crash when RTCP is not available during SSRC change
In r400089, a patch was put in to correct erroneous RTCP statistic resets. Unfortunately, ast_rtp_read can be called on an RTP instance that does not have RTCP information. This patch prevents that crash by only resetting the statistics if we do actually have an RTCP instance. (issue AST-1174) (closes issue ASTERISK-22667) Reported by: John Bigelow ........ Merged revisions 401445 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 401446 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 401447 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@401450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index e2a105662..bcb0b0123 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -3699,10 +3699,12 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
rtp->rxcount = 0;
rtp->cycles = 0;
rtp->lastrxseqno = 0;
- rtp->rtcp->expected_prior = 0;
- rtp->rtcp->received_prior = 0;
rtp->last_seqno = 0;
rtp->last_end_timestamp = 0;
+ if (rtp->rtcp) {
+ rtp->rtcp->expected_prior = 0;
+ rtp->rtcp->received_prior = 0;
+ }
}
rtp->rxssrc = ssrc;