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

Unified Diff: webrtc/modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c

Issue 1979973003: Fix UBSan errors (left shift of negative value, left shift overflows int) (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: variable name 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
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/codecs/isac/main/source/entropy_coding.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c b/webrtc/modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c
index 63e4928bd8814e5e48ce2050d42d3888851bdb74..47bbe31b8ae4d9e898cfabea845adb7ffb912fcc 100644
--- a/webrtc/modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c
+++ b/webrtc/modules/audio_coding/codecs/isac/main/source/arith_routines_hist.c
@@ -214,10 +214,10 @@ int WebRtcIsac_DecHistOneStepMulti(int *data, /* output: data vector */
if (streamdata->stream_index == 0) /* first time decoder is called for this stream */
{
/* read first word from bytestream */
- streamval = *stream_ptr << 24;
- streamval |= *++stream_ptr << 16;
- streamval |= *++stream_ptr << 8;
- streamval |= *++stream_ptr;
+ streamval = (uint32_t)(*stream_ptr) << 24;
+ streamval |= (uint32_t)(*++stream_ptr) << 16;
+ streamval |= (uint32_t)(*++stream_ptr) << 8;
+ streamval |= (uint32_t)(*++stream_ptr);
} else {
streamval = streamdata->streamval;
}
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/codecs/isac/main/source/entropy_coding.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698