diff options
author | Joshua Colp <jcolp@digium.com> | 2017-11-30 16:12:55 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2017-12-13 07:11:47 -0600 |
commit | fb18797ae09a685ec71101499fb1c1c606b16397 (patch) | |
tree | e61903330cc9efa236d1dd1940fef1e779b79cef /res/res_rtp_asterisk.c | |
parent | 6dca42879ca860033823fc6b3d2cf3b754350583 (diff) |
AST-2017-012: Place single RTCP report block at beginning of report.14
When the RTCP code was transitioned over to Stasis a code change
was made to keep track of how many reports are present. This count
controlled where report blocks were placed in the RTCP report.
If a compound RTCP packet was received this logic would incorrectly
place a report block in the wrong location resulting in a write
to an invalid location.
This change removes this counting logic and always places the report
block at the first position. If in the future multiple reports are
supported the logic can be extended but for now keeping a count
serves no purpose.
ASTERISK-27382
ASTERISK-27429
Change-Id: Iad6c8a9985c4b608ef493e19c421211615485116
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r-- | res/res_rtp_asterisk.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 2faf2fdbf..2dd1bd2c6 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -4702,7 +4702,6 @@ static struct ast_frame *ast_rtcp_interpret(struct ast_rtp_instance *instance, c unsigned int first_word; /*! True if we have seen an acceptable SSRC to learn the remote RTCP address */ unsigned int ssrc_seen; - int report_counter = 0; struct ast_rtp_rtcp_report_block *report_block; struct ast_frame *f = &ast_null_frame; @@ -4916,7 +4915,7 @@ static struct ast_frame *ast_rtcp_interpret(struct ast_rtp_instance *instance, c if (!report_block) { return &ast_null_frame; } - rtcp_report->report_block[report_counter] = report_block; + rtcp_report->report_block[0] = report_block; report_block->source_ssrc = ntohl(rtcpheader[i]); report_block->lost_count.packets = ntohl(rtcpheader[i + 1]) & 0x00ffffff; report_block->lost_count.fraction = ((ntohl(rtcpheader[i + 1]) & 0xff000000) >> 24); @@ -4953,7 +4952,6 @@ static struct ast_frame *ast_rtcp_interpret(struct ast_rtp_instance *instance, c ast_verbose(" DLSR: %4.4f (sec)\n",(double)report_block->dlsr / 65536.0); ast_verbose(" RTT: %4.4f(sec)\n", rtp->rtcp->rtt); } - report_counter++; } /* If and when we handle more than one report block, this should occur outside * this loop. |