From 9a7fe3cc689febe6f0e0558b90a04444c14cc4bf Mon Sep 17 00:00:00 2001 From: Raja Subramanian Date: Thu, 18 Jun 2026 20:08:52 +0530 Subject: [PATCH] Do not log due to negative getting interpreted as large unsigned positive (#4605) --- pkg/sfu/connectionquality/scorer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/sfu/connectionquality/scorer.go b/pkg/sfu/connectionquality/scorer.go index b415f75a0..471b291b6 100644 --- a/pkg/sfu/connectionquality/scorer.go +++ b/pkg/sfu/connectionquality/scorer.go @@ -482,7 +482,11 @@ func (q *qualityScorer) updateAtLocked(stat *windowStat, at time.Time) { ulgr.Debugw("quality rise") default: packets := stat.packets + stat.packetsPadding - if packets != 0 && ((stat.packetsLost-stat.packetsMissing-stat.packetsOutOfOrder)*100/packets) > 10 { + lost := stat.packetsLost - stat.packetsMissing - stat.packetsOutOfOrder + if int32(lost) < 0 { + lost = 0 + } + if packets != 0 && lost*100/packets > 10 { ulgr.Debugw("quality hold - high loss") } }