diff --git a/tools/ubsan/blacklist.txt b/tools/ubsan/blacklist.txt index d48b31d2a9..1ddbbadb16 100644 --- a/tools/ubsan/blacklist.txt +++ b/tools/ubsan/blacklist.txt @@ -15,10 +15,7 @@ src:*/third_party/yasm/* src:*/usr/* ############################################################################# -# iSAC exhibits a few problems (entropy coding and a unit test). # https://bugs.chromium.org/p/webrtc/issues/detail?id=5513 -src:*/webrtc/modules/audio_coding/codecs/isac/main/source/entropy_coding.c -src:*/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c fun:*FilterBanksTest*CalculateResidualEnergyTester* ############################################################################# @@ -35,4 +32,4 @@ src:*/webrtc/common_audio/signal_processing/resample_by_2_internal.c fun:*WebRtcSpl_AddSatW32* fun:*WebRtcSpl_SubSatW32* fun:*WebRtcSpl_DivW32HiLow* -fun:*GmmProbability* \ No newline at end of file +fun:*GmmProbability* diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c index 2379ba5066..c9ddf93580 100644 --- a/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c +++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/entropy_coding.c @@ -392,13 +392,13 @@ static void GenerateDitherQ7(int16_t *bufQ7, seed = WEBRTC_SPL_UMUL(seed, 196314165) + 907633515; /* fixed-point dither sample between -64 and 64 (Q7) */ - dither1_Q7 = (int16_t)(((int32_t)seed + 16777216) >> 25); + dither1_Q7 = (int16_t)(((int32_t)(seed + 16777216)) >> 25); /* new random unsigned int32_t */ seed = WEBRTC_SPL_UMUL(seed, 196314165) + 907633515; /* fixed-point dither sample between -64 and 64 */ - dither2_Q7 = (int16_t)((seed + 16777216) >> 25); + dither2_Q7 = (int16_t)(((int32_t)(seed + 16777216)) >> 25); shft = (int16_t)(WEBRTC_SPL_RSHIFT_U32(seed, 25) & 15); if (shft < 5) @@ -432,7 +432,7 @@ static void GenerateDitherQ7(int16_t *bufQ7, seed = WEBRTC_SPL_UMUL(seed, 196314165) + 907633515; /* fixed-point dither sample between -64 and 64 */ - dither1_Q7 = (int16_t)(((int32_t)seed + 16777216) >> 25); + dither1_Q7 = (int16_t)(((int32_t)(seed + 16777216)) >> 25); /* dither sample is placed in either even or odd index */ shft = (int16_t)(WEBRTC_SPL_RSHIFT_U32(seed, 25) & 1); /* either 0 or 1 */ diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/entropy_coding.c b/webrtc/modules/audio_coding/codecs/isac/main/source/entropy_coding.c index dd1d64af7b..c1204ad03a 100644 --- a/webrtc/modules/audio_coding/codecs/isac/main/source/entropy_coding.c +++ b/webrtc/modules/audio_coding/codecs/isac/main/source/entropy_coding.c @@ -182,13 +182,13 @@ static void GenerateDitherQ7Lb(int16_t* bufQ7, uint32_t seed, /* Fixed-point dither sample between -64 and 64 (Q7). */ /* dither = seed * 128 / 4294967295 */ - dither1_Q7 = (int16_t)(((int)seed + 16777216) >> 25); + dither1_Q7 = (int16_t)(((int32_t)(seed + 16777216)) >> 25); /* New random unsigned int. */ seed = (seed * 196314165) + 907633515; /* Fixed-point dither sample between -64 and 64. */ - dither2_Q7 = (int16_t)(((int)seed + 16777216) >> 25); + dither2_Q7 = (int16_t)(((int32_t)(seed + 16777216)) >> 25); shft = (seed >> 25) & 15; if (shft < 5) { @@ -214,7 +214,7 @@ static void GenerateDitherQ7Lb(int16_t* bufQ7, uint32_t seed, seed = (seed * 196314165) + 907633515; /* Fixed-point dither sample between -64 and 64. */ - dither1_Q7 = (int16_t)(((int)seed + 16777216) >> 25); + dither1_Q7 = (int16_t)(((int32_t)(seed + 16777216)) >> 25); /* Dither sample is placed in either even or odd index. */ shft = (seed >> 25) & 1; /* Either 0 or 1 */ @@ -254,7 +254,7 @@ static void GenerateDitherQ7LbUB( /* Fixed-point dither sample between -64 and 64 (Q7). */ /* bufQ7 = seed * 128 / 4294967295 */ - bufQ7[k] = (int16_t)(((int)seed + 16777216) >> 25); + bufQ7[k] = (int16_t)(((int32_t)(seed + 16777216)) >> 25); /* Scale by 0.35. */ bufQ7[k] = (int16_t)WEBRTC_SPL_MUL_16_16_RSFT(bufQ7[k], 2048, 13);