utils/GetLE32: correct uint32 promotion

avoids undefined behavior when shifting an int by 24.

BUG=278

Change-Id: I7b5ad96715002c8f425d81789bb75f22c176ab76
This commit is contained in:
James Zern 2015-11-23 22:41:17 -08:00
parent 158763dea3
commit f1694481a9

View File

@ -62,7 +62,7 @@ static WEBP_INLINE int GetLE24(const uint8_t* const data) {
}
static WEBP_INLINE uint32_t GetLE32(const uint8_t* const data) {
return (uint32_t)GetLE16(data) | (GetLE16(data + 2) << 16);
return GetLE16(data) | ((uint32_t)GetLE16(data + 2) << 16);
}
// Store 16, 24 or 32 bits in little-endian order.