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 <joedow@google.com>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#41538}
This commit is contained in:
Joe Downing 2024-01-11 17:46:21 -08:00 committed by WebRTC LUCI CQ
parent f868b76376
commit 3b500e60e8

View File

@ -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_));
}