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

Unified Diff: webrtc/common_audio/signal_processing/levinson_durbin.c

Issue 3009123002: Move UBSan warnings from a blacklist to the source (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/common_audio/signal_processing/levinson_durbin.c
diff --git a/webrtc/common_audio/signal_processing/levinson_durbin.c b/webrtc/common_audio/signal_processing/levinson_durbin.c
index c8e58ba4555e4972296dacf7044e5cb8b51ff976..3e16b23f8b01c8e53ba85331e2d71dfecb342fe1 100644
--- a/webrtc/common_audio/signal_processing/levinson_durbin.c
+++ b/webrtc/common_audio/signal_processing/levinson_durbin.c
@@ -16,11 +16,13 @@
*/
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
+#include "webrtc/rtc_base/sanitizer.h"
#define SPL_LEVINSON_MAXORDER 20
-int16_t WebRtcSpl_LevinsonDurbin(const int32_t* R, int16_t* A, int16_t* K,
- size_t order)
+int16_t RTC_NO_SANITIZE("signed-integer-overflow") // bugs.webrtc.org/5486
+WebRtcSpl_LevinsonDurbin(const int32_t* R, int16_t* A, int16_t* K,
+ size_t order)
{
size_t i, j;
// Auto-correlation coefficients in high precision
@@ -44,6 +46,8 @@ int16_t WebRtcSpl_LevinsonDurbin(const int32_t* R, int16_t* A, int16_t* K,
for (i = 0; i <= order; ++i)
{
temp1W32 = R[i] * (1 << norm);
+ // UBSan: 12 * 268435456 cannot be represented in type 'int'
+
// Put R in hi and low format
R_hi[i] = (int16_t)(temp1W32 >> 16);
R_low[i] = (int16_t)((temp1W32 - ((int32_t)R_hi[i] * 65536)) >> 1);

Powered by Google App Engine
This is Rietveld 408576698