From: Tom Finegan Date: Fri, 27 May 2016 16:16:35 +0000 (-0700) Subject: vpx_ports/mem_ops.h: cast the lhs of bitwise shifts of 24. X-Git-Tag: v1.6.0~103^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1de6226176ff90552ebe7473d8a76e388685053;p=platform%2Fupstream%2Flibvpx.git vpx_ports/mem_ops.h: cast the lhs of bitwise shifts of 24. C does not allow for shifting into the sign bit of a signed integer, and the two instances here become signed ints via promotion. Explcitly cast them to unsigned MEM_VALUE_T to avoid the problem. BUG=https://bugs.chromium.org/p/chromium/issues/detail?id=614648 Change-Id: I51165361a8c6cbb5c378cf7e4e0f4b80b3ad9a6e --- diff --git a/vpx_ports/mem_ops.h b/vpx_ports/mem_ops.h index 80c034e..620df31 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 = ((unsigned int)mem[0]) << 24; + val = ((unsigned MEM_VALUE_T)mem[0]) << 24; val |= mem[1] << 16; val |= mem[2] << 8; val |= mem[3]; @@ -125,7 +125,7 @@ static unsigned MEM_VALUE_T mem_get_le32(const void *vmem) { unsigned MEM_VALUE_T val; const MAU_T *mem = (const MAU_T *)vmem; - val = mem[3] << 24; + val = ((unsigned MEM_VALUE_T)mem[3]) << 24; val |= mem[2] << 16; val |= mem[1] << 8; val |= mem[0];