diff options
Diffstat (limited to 'c/enc/hash.h')
-rw-r--r-- | c/enc/hash.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/c/enc/hash.h b/c/enc/hash.h index ba9b0d8..9533b05 100644 --- a/c/enc/hash.h +++ b/c/enc/hash.h @@ -548,6 +548,8 @@ static BROTLI_INLINE void FindCompoundDictionaryMatch( source = (const uint8_t*)BROTLI_UNALIGNED_LOAD_PTR((const uint8_t**)tail); } + BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask); + for (i = 0; i < 4; ++i) { const size_t distance = (size_t)distance_cache[i]; size_t offset; @@ -657,6 +659,8 @@ static BROTLI_INLINE size_t FindAllCompoundDictionaryMatches( source = (const uint8_t*)BROTLI_UNALIGNED_LOAD_PTR((const uint8_t**)tail); } + BROTLI_DCHECK(cur_ix_masked + max_length <= ring_buffer_mask); + while (item == 0) { size_t offset; size_t distance; |