UDT: Fix divide by zero.

This commit is contained in:
Kleissner
2021-11-01 08:50:33 +01:00
parent 0368752324
commit 81b409d5a4

View File

@@ -179,7 +179,7 @@ func (ncc NativeCongestionControl) OnNAK(parms CongestionControlParms, losslist
} else {
if ncc.decCount < 5 {
ncc.nakCount++
if ncc.nakCount%ncc.decRandom != 0 {
if ncc.decRandom != 0 && ncc.nakCount%ncc.decRandom != 0 {
ncc.decCount++
return
}