diff options
author | Yann Collet <cyan@fb.com> | 2017-11-07 19:29:28 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2017-11-07 19:29:28 (GMT) |
commit | c49f66f2adf27af499cf7efacbad656bf30d671a (patch) | |
tree | afdb8e499f6a514fbbe5196962ddabcd17ecbc82 | |
parent | 5512a5f1a932d4d906f3bbecf1932863bcac7b2b (diff) | |
download | lz4-c49f66f2adf27af499cf7efacbad656bf30d671a.zip lz4-c49f66f2adf27af499cf7efacbad656bf30d671a.tar.gz lz4-c49f66f2adf27af499cf7efacbad656bf30d671a.tar.bz2 |
ensure `pattern` is a 1-byte repetition
-rw-r--r-- | lib/lz4hc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c index 5882109..93017f1 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -268,7 +268,8 @@ LZ4_FORCE_INLINE int LZ4HC_InsertAndGetWiderMatch ( if (nextOffset==1) { /* may be a repeated pattern */ if (repeat == rep_untested) { - if ((pattern & 0xFFFF) == (pattern >> 16)) { /* is it enough ? */ + if ( ((pattern & 0xFFFF) == (pattern >> 16)) + & ((pattern & 0xFF) == (pattern >> 24)) ) { repeat = rep_confirmed; srcPatternLength = LZ4HC_countPattern(ip+4, iHighLimit, pattern) + 4; } else { |