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

Unified Diff: webrtc/modules/audio_processing/aecm/aecm_core.cc

Issue 3005003002: Make UBSan warnings fatal and fix the existing ones (Closed)
Patch Set: Address review comments 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
Index: webrtc/modules/audio_processing/aecm/aecm_core.cc
diff --git a/webrtc/modules/audio_processing/aecm/aecm_core.cc b/webrtc/modules/audio_processing/aecm/aecm_core.cc
index 0e0b6ffbfd48ee055d42d36067c3d6c04428d4e4..580915483dfe9746c275e467b4771656015a1919 100644
--- a/webrtc/modules/audio_processing/aecm/aecm_core.cc
+++ b/webrtc/modules/audio_processing/aecm/aecm_core.cc
@@ -24,6 +24,7 @@ extern "C" {
}
#include "webrtc/rtc_base/checks.h"
+#include "webrtc/rtc_base/safe_conversions.h"
#include "webrtc/typedefs.h"
#ifdef AEC_DEBUG
@@ -927,8 +928,8 @@ void WebRtcAecm_UpdateChannel(AecmCore* aecm,
{
// We need to shift down before multiplication
shiftChFar = 32 - zerosCh - zerosFar;
- tmpU32no1 = (aecm->channelAdapt32[i] >> shiftChFar) *
- far_spectrum[i];
+ tmpU32no1 = rtc::dchecked_cast<uint32_t>(
+ aecm->channelAdapt32[i] >> shiftChFar) * far_spectrum[i];
}
// Determine Q-domain of numerator
zerosNum = WebRtcSpl_NormU32(tmpU32no1);

Powered by Google App Engine
This is Rietveld 408576698