aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDayeong Lee <dayeonglee@google.com>2023-05-05 23:52:47 +0900
committerDayeong Lee <dayeonglee@google.com>2023-05-05 23:52:47 +0900
commit1538cb6d1105d33018dd9634dd1487b80162e55f (patch)
tree34783bab4cb7e868688d0a6d75777db7d3af421a
parentacbdce637e3bddaf23819e9e87510d03649ddfec (diff)
downloadliblc3-1538cb6d1105d33018dd9634dd1487b80162e55f.tar.gz
Cast uint8_t value to unsigned before doing bit shift
-rw-r--r--src/bits.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bits.c b/src/bits.c
index 09b6da7..881258b 100644
--- a/src/bits.c
+++ b/src/bits.c
@@ -322,7 +322,7 @@ static inline void accu_load(struct lc3_bits_accu *accu,
for ( ; nbytes; nbytes--) {
accu->v >>= 8;
- accu->v |= *(--buffer->p_bw) << (LC3_ACCU_BITS - 8);
+ accu->v |= (unsigned)*(--buffer->p_bw) << (LC3_ACCU_BITS - 8);
}
if (accu->n >= 8) {