diff --git a/modules/audio_coding/codecs/ilbc/cb_construct.c b/modules/audio_coding/codecs/ilbc/cb_construct.c index e2ae361ee3..1e9a7040c7 100644 --- a/modules/audio_coding/codecs/ilbc/cb_construct.c +++ b/modules/audio_coding/codecs/ilbc/cb_construct.c @@ -21,6 +21,15 @@ #include "modules/audio_coding/codecs/ilbc/defines.h" #include "modules/audio_coding/codecs/ilbc/gain_dequant.h" #include "modules/audio_coding/codecs/ilbc/get_cd_vec.h" +#include "rtc_base/sanitizer.h" + +// An arithmetic operation that is allowed to overflow. (It's still undefined +// behavior, so not a good idea; this just makes UBSan ignore the violation, so +// that our old code can continue to do what it's always been doing.) +static inline int32_t RTC_NO_SANITIZE("signed-integer-overflow") + OverflowingAddS32S32ToS32(int32_t a, int32_t b) { + return a + b; +} /*----------------------------------------------------------------* * Construct decoded vector from codebook and gains. @@ -62,7 +71,7 @@ bool WebRtcIlbcfix_CbConstruct( for (j=0;j> 14); }