From 3b500e60e857eb799123d784a3af790bb4761550 Mon Sep 17 00:00:00 2001 From: Joe Downing Date: Thu, 11 Jan 2024 17:46:21 -0800 Subject: [PATCH] Fixing a crash in SendSideBandwidthEstmation This CL addresses a crash we started seeing in M121 where a function is being called on loss_based_bandwidth_estimator_v2_ without checking whether it is enabled (it's not) which leads to absl::optional<> throwing since config_ is not valid. Bug: chromium:1518852 Change-Id: Iffef1051fe7988046e33a709ce281aebefd2bcd7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/334103 Commit-Queue: Joe Downing Reviewed-by: Per Kjellander Cr-Commit-Position: refs/heads/main@{#41538} --- .../goog_cc/send_side_bandwidth_estimation.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.cc b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.cc index 22693d67e9..211d86c95d 100644 --- a/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.cc +++ b/modules/congestion_controller/goog_cc/send_side_bandwidth_estimation.cc @@ -281,7 +281,8 @@ void SendSideBandwidthEstimation::OnRouteChange() { uma_update_state_ = kNoUpdate; uma_rtt_state_ = kNoUpdate; last_rtc_event_log_ = Timestamp::MinusInfinity(); - if (loss_based_bandwidth_estimator_v2_->UseInStartPhase()) { + if (LossBasedBandwidthEstimatorV2Enabled() && + loss_based_bandwidth_estimator_v2_->UseInStartPhase()) { loss_based_bandwidth_estimator_v2_.reset( new LossBasedBweV2(key_value_config_)); }