Commit 301e3452 authored by Yaowu Xu's avatar Yaowu Xu
Browse files

Convert to unsigned int before left shift

This is to fix overflow when 128 is left shifted by 24.

Change-Id: Ibb5f6813536d985afa003a9848c0c3dd358955a7
parent ba8651d4
......@@ -89,7 +89,7 @@ static unsigned MEM_VALUE_T mem_get_be32(const void *vmem) {
unsigned MEM_VALUE_T val;
const MAU_T *mem = (const MAU_T *)vmem;
val = mem[0] << 24;
val = ((unsigned int)mem[0]) << 24;
val |= mem[1] << 16;
val |= mem[2] << 8;
val |= mem[3];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment