提交 af3551f7 authored 作者: Mike Jerris's avatar Mike Jerris

Merge pull request #1770 in FS/freeswitch from ~DRAGOS_OANCEA/freeswitch-dragos:FS-11715 to master

* commit '500b4c23':
  FS-11715: sanitize negative value for pkt_lost
...@@ -1838,6 +1838,8 @@ static void rtcp_generate_report_block(switch_rtp_t *rtp_session, struct switch_ ...@@ -1838,6 +1838,8 @@ static void rtcp_generate_report_block(switch_rtp_t *rtp_session, struct switch_
} }
pkt_lost = expected_pkt - stats->period_pkt_count; pkt_lost = expected_pkt - stats->period_pkt_count;
if (pkt_lost < 0) pkt_lost = 0;
stats->cum_lost=stats->cum_lost+pkt_lost; stats->cum_lost=stats->cum_lost+pkt_lost;
if (expected_pkt > 0 && pkt_lost > 0) { if (expected_pkt > 0 && pkt_lost > 0) {
rtcp_report_block->fraction = (uint8_t) (pkt_lost * 256 / expected_pkt); rtcp_report_block->fraction = (uint8_t) (pkt_lost * 256 / expected_pkt);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论