From b939d35e8ec3b044ba1f3e58188d9eeb0d89c364 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Fri, 30 Nov 2018 08:59:00 +0100 Subject: [PATCH] Fixes DCHECK bug in LinkCapacityEstimator. Conversion to kbps will fail if the estimate is lower than the deviation estimate * 3, since that would produce a negative value. Bug: webrtc:9718 Change-Id: I83b52acd476d90b1f22c9db9894fa26c9a3e8e17 Reviewed-on: https://webrtc-review.googlesource.com/c/112560 Reviewed-by: Niels Moller Reviewed-by: Sebastian Jansson Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#25854} --- .../congestion_controller/goog_cc/link_capacity_estimator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/congestion_controller/goog_cc/link_capacity_estimator.cc b/modules/congestion_controller/goog_cc/link_capacity_estimator.cc index d16f07482e..8f59c9a91e 100644 --- a/modules/congestion_controller/goog_cc/link_capacity_estimator.cc +++ b/modules/congestion_controller/goog_cc/link_capacity_estimator.cc @@ -25,8 +25,8 @@ DataRate LinkCapacityEstimator::UpperBound() const { DataRate LinkCapacityEstimator::LowerBound() const { if (estimate_kbps_.has_value()) - return DataRate::kbps(estimate_kbps_.value() - - 3 * deviation_estimate_kbps()); + return DataRate::kbps( + std::max(0.0, estimate_kbps_.value() - 3 * deviation_estimate_kbps())); return DataRate::Zero(); }