diff options
author | eustas <eustas.ru@gmail.com> | 2016-06-13 16:28:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-13 16:28:19 +0200 |
commit | a08c36bd86466307cf58c915f9019266a6e96856 (patch) | |
tree | 4137a0bca1e96afdceef27cabaccc6706a1c9b35 | |
parent | bc7f0f831d5147999a78e03831f4559ff1dfec65 (diff) | |
download | brotli-a08c36bd86466307cf58c915f9019266a6e96856.zip brotli-a08c36bd86466307cf58c915f9019266a6e96856.tar.gz brotli-a08c36bd86466307cf58c915f9019266a6e96856.tar.bz2 |
Fix implicit 32->64 bit conversion
-rw-r--r-- | enc/hash_longest_match_inc.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/enc/hash_longest_match_inc.h b/enc/hash_longest_match_inc.h index 3c2fbbd..860ea5e 100644 --- a/enc/hash_longest_match_inc.h +++ b/enc/hash_longest_match_inc.h @@ -255,8 +255,9 @@ static BROTLI_INLINE int FN(FindLongestMatch)(HashLongestMatch* self, &kBrotliDictionary[offset], len); if (matchlen + kCutoffTransformsCount > len && matchlen > 0) { const size_t transform_id = kCutoffTransforms[len - matchlen]; - const size_t word_id = dist + - transform_id * (1u << kBrotliDictionarySizeBitsByLength[len]); + const size_t transform_step = + (size_t)1 << kBrotliDictionarySizeBitsByLength[len]; + const size_t word_id = dist + transform_id * transform_step; const size_t backward = max_backward + word_id + 1; double score = BackwardReferenceScore(matchlen, backward); if (best_score < score) { |