projects
/
platform
/
upstream
/
lz4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5512a5f
)
ensure `pattern` is a 1-byte repetition
author
Yann Collet
<cyan@fb.com>
Tue, 7 Nov 2017 19:29:28 +0000
(11:29 -0800)
committer
Yann Collet
<cyan@fb.com>
Tue, 7 Nov 2017 19:29:28 +0000
(11:29 -0800)
lib/lz4hc.c
patch
|
blob
|
history
diff --git
a/lib/lz4hc.c
b/lib/lz4hc.c
index
5882109
..
93017f1
100644
(file)
--- 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 {