Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Unified Diff: webrtc/modules/pacing/alr_detector.cc

Issue 3005003002: Make UBSan warnings fatal and fix the existing ones (Closed)
Patch Set: Revert one fix because the overflow was relied on Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/audio_processing/aecm/aecm_core.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/pacing/alr_detector.cc
diff --git a/webrtc/modules/pacing/alr_detector.cc b/webrtc/modules/pacing/alr_detector.cc
index 7d62b212511c56be3c0a779445fdeb1fa434bd8c..68732105c1db20c8380df4cc10032439212d2542 100644
--- a/webrtc/modules/pacing/alr_detector.cc
+++ b/webrtc/modules/pacing/alr_detector.cc
@@ -67,8 +67,9 @@ void AlrDetector::OnBytesSent(size_t bytes_sent, int64_t delta_time_ms) {
void AlrDetector::SetEstimatedBitrate(int bitrate_bps) {
RTC_DCHECK(bitrate_bps);
- alr_budget_.set_target_rate_kbps(bitrate_bps * bandwidth_usage_percent_ /
- (1000 * 100));
+ const auto target_rate_kbps = int64_t{bitrate_bps} *
+ bandwidth_usage_percent_ / (1000 * 100);
+ alr_budget_.set_target_rate_kbps(rtc::dchecked_cast<int>(target_rate_kbps));
}
rtc::Optional<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime()
« no previous file with comments | « webrtc/modules/audio_processing/aecm/aecm_core.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698