diff options
author | Yaowu Xu <yaowu@google.com> | 2016-05-25 14:02:22 -0700 |
---|---|---|
committer | Yaowu Xu <yaowu@google.com> | 2016-05-26 08:46:01 -0700 |
commit | 301e34527307690e66ac53f37022002c97e3af0d (patch) | |
tree | 612bd98fc4f2257c0efb187003f1c3d75fbbcb62 /vpx_ports | |
parent | ba8651d474d09bead393cc81b139607210374bb8 (diff) | |
download | libvpx-301e34527307690e66ac53f37022002c97e3af0d.tar libvpx-301e34527307690e66ac53f37022002c97e3af0d.tar.gz libvpx-301e34527307690e66ac53f37022002c97e3af0d.tar.bz2 libvpx-301e34527307690e66ac53f37022002c97e3af0d.zip |
Convert to unsigned int before left shift
This is to fix overflow when 128 is left shifted by 24.
Change-Id: Ibb5f6813536d985afa003a9848c0c3dd358955a7
Diffstat (limited to 'vpx_ports')
-rw-r--r-- | vpx_ports/mem_ops.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vpx_ports/mem_ops.h b/vpx_ports/mem_ops.h index 1f8f914f1..80c034e5f 100644 --- a/vpx_ports/mem_ops.h +++ b/vpx_ports/mem_ops.h @@ -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]; |