mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
utils/GetLE32: correct uint32 promotion
avoids undefined behavior when shifting an int by 24. BUG=278 Change-Id: I7b5ad96715002c8f425d81789bb75f22c176ab76
This commit is contained in:
parent
158763dea3
commit
f1694481a9
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user