From 301e34527307690e66ac53f37022002c97e3af0d Mon Sep 17 00:00:00 2001 From: Yaowu Xu Date: Wed, 25 May 2016 14:02:22 -0700 Subject: [PATCH] Convert to unsigned int before left shift This is to fix overflow when 128 is left shifted by 24. Change-Id: Ibb5f6813536d985afa003a9848c0c3dd358955a7 --- vpx_ports/mem_ops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vpx_ports/mem_ops.h b/vpx_ports/mem_ops.h index 1f8f914..80c034e 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]; -- 2.7.4