| Index: webrtc/common_audio/signal_processing/division_operations.c
|
| diff --git a/webrtc/common_audio/signal_processing/division_operations.c b/webrtc/common_audio/signal_processing/division_operations.c
|
| index eaa06a1ff9299c20b7ebdcc5ed9ba30303dd5c50..2d420525bab1c29accf5a144130a4ec5abeddade 100644
|
| --- a/webrtc/common_audio/signal_processing/division_operations.c
|
| +++ b/webrtc/common_audio/signal_processing/division_operations.c
|
| @@ -22,6 +22,7 @@
|
| */
|
|
|
| #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
|
| +#include "webrtc/rtc_base/sanitizer.h"
|
|
|
| uint32_t WebRtcSpl_DivU32U16(uint32_t num, uint16_t den)
|
| {
|
| @@ -97,7 +98,8 @@ int32_t WebRtcSpl_DivResultInQ31(int32_t num, int32_t den)
|
| return div;
|
| }
|
|
|
| -int32_t WebRtcSpl_DivW32HiLow(int32_t num, int16_t den_hi, int16_t den_low)
|
| +int32_t RTC_NO_SANITIZE("signed-integer-overflow") // bugs.webrtc.org/5486
|
| +WebRtcSpl_DivW32HiLow(int32_t num, int16_t den_hi, int16_t den_low)
|
| {
|
| int16_t approx, tmp_hi, tmp_low, num_hi, num_low;
|
| int32_t tmpW32;
|
| @@ -110,6 +112,7 @@ int32_t WebRtcSpl_DivW32HiLow(int32_t num, int16_t den_hi, int16_t den_low)
|
| // tmpW32 = den * approx
|
|
|
| tmpW32 = (int32_t)0x7fffffffL - tmpW32; // result in Q30 (tmpW32 = 2.0-(den*approx))
|
| + // UBSan: 2147483647 - -2 cannot be represented in type 'int'
|
|
|
| // Store tmpW32 in hi and low format
|
| tmp_hi = (int16_t)(tmpW32 >> 16);
|
|
|