mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-15 21:39:59 +02:00
near lossless: fix unsigned int overflow warnings.
Change-Id: Ic1111a66761b5821cbbea1c91b038b2327dd20b5
This commit is contained in:
@ -1261,12 +1261,13 @@ static WEBP_INLINE uint32_t ApplyPaletteHash0(uint32_t color) {
|
||||
|
||||
static WEBP_INLINE uint32_t ApplyPaletteHash1(uint32_t color) {
|
||||
// Forget about alpha.
|
||||
return ((color & 0x00ffffffu) * 4222244071u) >> (32 - PALETTE_INV_SIZE_BITS);
|
||||
return ((uint32_t)((color & 0x00ffffffu) * 4222244071ull)) >>
|
||||
(32 - PALETTE_INV_SIZE_BITS);
|
||||
}
|
||||
|
||||
static WEBP_INLINE uint32_t ApplyPaletteHash2(uint32_t color) {
|
||||
// Forget about alpha.
|
||||
return (color & 0x00ffffffu) * ((1u << 31) - 1) >>
|
||||
return ((uint32_t)((color & 0x00ffffffu) * ((1ull << 31) - 1))) >>
|
||||
(32 - PALETTE_INV_SIZE_BITS);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user