diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2019-01-09 20:21:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 20:21:39 (GMT) |
commit | c750cbe5c17db3051961bd508af3ef8d4075a7c8 (patch) | |
tree | 032352509f0885ea351d4e84b2f4175f3ce6f4c7 | |
parent | cc34d3ff7590d6e8049a2c7ec1c2a053465e48b0 (diff) | |
parent | 06e080ace46a5048fbe5c15d4fad1609ddc5c5f0 (diff) | |
download | lz4-c750cbe5c17db3051961bd508af3ef8d4075a7c8.zip lz4-c750cbe5c17db3051961bd508af3ef8d4075a7c8.tar.gz lz4-c750cbe5c17db3051961bd508af3ef8d4075a7c8.tar.bz2 |
Merge pull request #631 from qiuyangs/dev
lz4hc.c: change (length >> 8) to (length / 255)
-rw-r--r-- | lib/lz4hc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4hc.c b/lib/lz4hc.c index 56c8f47..86db155 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -437,7 +437,7 @@ LZ4_FORCE_INLINE int LZ4HC_encodeSequence ( /* Encode Literal length */ length = (size_t)(*ip - *anchor); - if ((limit) && ((*op + (length >> 8) + length + (2 + 1 + LASTLITERALS)) > oend)) return 1; /* Check output limit */ + if ((limit) && ((*op + (length / 255) + length + (2 + 1 + LASTLITERALS)) > oend)) return 1; /* Check output limit */ if (length >= RUN_MASK) { size_t len = length - RUN_MASK; *token = (RUN_MASK << ML_BITS); @@ -458,7 +458,7 @@ LZ4_FORCE_INLINE int LZ4HC_encodeSequence ( /* Encode MatchLength */ assert(matchLength >= MINMATCH); length = (size_t)(matchLength - MINMATCH); - if ((limit) && (*op + (length >> 8) + (1 + LASTLITERALS) > oend)) return 1; /* Check output limit */ + if ((limit) && (*op + (length / 255) + (1 + LASTLITERALS) > oend)) return 1; /* Check output limit */ if (length >= ML_MASK) { *token += ML_MASK; length -= ML_MASK; |