Prevent DCHECK failure in QUIC congestion control I saw a DCHECK failure in GeneralLossAlgorithm::DetectLosses where least_in_flight_ was being compared even though it was uninitialized. I'm unable to reproduce this reliably but this CL looks correct from code inspection. gfe-relnote: n/a, no behavior change PiperOrigin-RevId: 304603107 Change-Id: I8557403886143d763fd6c77be3a7ecbf76628ae2
diff --git a/quic/core/congestion_control/general_loss_algorithm.cc b/quic/core/congestion_control/general_loss_algorithm.cc index 6c09013..7354f50 100644 --- a/quic/core/congestion_control/general_loss_algorithm.cc +++ b/quic/core/congestion_control/general_loss_algorithm.cc
@@ -31,7 +31,7 @@ const AckedPacketVector& packets_acked, LostPacketVector* packets_lost) { loss_detection_timeout_ = QuicTime::Zero(); - if (!packets_acked.empty() && + if (!packets_acked.empty() && least_in_flight_.IsInitialized() && packets_acked.front().packet_number == least_in_flight_) { if (packets_acked.back().packet_number == largest_newly_acked && least_in_flight_ + packets_acked.size() - 1 == largest_newly_acked) {