summaryrefslogtreecommitdiff
path: root/thirdparty/libwebp/src/enc/backward_references_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/libwebp/src/enc/backward_references_enc.c')
-rw-r--r--thirdparty/libwebp/src/enc/backward_references_enc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/thirdparty/libwebp/src/enc/backward_references_enc.c b/thirdparty/libwebp/src/enc/backward_references_enc.c
index 3ab7b0ac7d..d445b40fc5 100644
--- a/thirdparty/libwebp/src/enc/backward_references_enc.c
+++ b/thirdparty/libwebp/src/enc/backward_references_enc.c
@@ -191,13 +191,14 @@ void VP8LHashChainClear(VP8LHashChain* const p) {
// -----------------------------------------------------------------------------
-#define HASH_MULTIPLIER_HI (0xc6a4a793ULL)
-#define HASH_MULTIPLIER_LO (0x5bd1e996ULL)
+static const uint32_t kHashMultiplierHi = 0xc6a4a793u;
+static const uint32_t kHashMultiplierLo = 0x5bd1e996u;
-static WEBP_INLINE uint32_t GetPixPairHash64(const uint32_t* const argb) {
+static WEBP_UBSAN_IGNORE_UNSIGNED_OVERFLOW WEBP_INLINE
+uint32_t GetPixPairHash64(const uint32_t* const argb) {
uint32_t key;
- key = (argb[1] * HASH_MULTIPLIER_HI) & 0xffffffffu;
- key += (argb[0] * HASH_MULTIPLIER_LO) & 0xffffffffu;
+ key = argb[1] * kHashMultiplierHi;
+ key += argb[0] * kHashMultiplierLo;
key = key >> (32 - HASH_BITS);
return key;
}