mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-24 04:36:25 +00:00
FS-11715: sanitize negative value for pkt_lost
This commit is contained in:
parent
da9c1618c5
commit
500b4c23b0
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user