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

Unified Diff: webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c

Issue 1989803002: Fix UBSan errors (left shift of negative value) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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_coding/codecs/isac/fix/source/decode.c
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c b/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c
index e3de437a58ded933ab1edf68b4dd9b61bec2a4f0..cf2d507cb57fb3c72248d6ae13e59f2a7e7db6b0 100644
--- a/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/source/decode.c
@@ -182,7 +182,7 @@ int WebRtcIsacfix_DecodeImpl(int16_t* signal_out16,
for (k = 0; k < FRAMESAMPLES/2; k++)
{
- Vector_Word32_1[k] = (Vector_Word16_2[k] * gainQ13) << 3; // Q25
+ Vector_Word32_1[k] = (Vector_Word16_2[k] * gainQ13) * (1 << 3); // Q25
}
@@ -192,7 +192,7 @@ int WebRtcIsacfix_DecodeImpl(int16_t* signal_out16,
/* --- Store Highpass Residual --- */
for (k = 0; k < FRAMESAMPLES/2; k++)
- Vector_Word32_1[k] = Vector_Word32_2[k] << 9; // Q16 -> Q25
+ Vector_Word32_1[k] = Vector_Word32_2[k] * (1 << 9); // Q16 -> Q25
for( k = 0; k < PITCH_MAX_LAG + 10; k++ )
(ISACdec_obj->plcstr_obj).prevHP[k] = Vector_Word32_1[FRAMESAMPLES/2 - (PITCH_MAX_LAG + 10) + k];

Powered by Google App Engine
This is Rietveld 408576698