summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-12-10 16:58:15 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-12-10 16:58:15 (GMT)
commite68d7dcf22d26300e6ce97395e52bcaabc28536f (patch)
tree310d8e3db9386503b9cc363bfcd9963de8b97086 /lib
parent3477cbac73ceee4fb7c77b7bae673877bd802d59 (diff)
downloadlz4-e68d7dcf22d26300e6ce97395e52bcaabc28536f.zip
lz4-e68d7dcf22d26300e6ce97395e52bcaabc28536f.tar.gz
lz4-e68d7dcf22d26300e6ce97395e52bcaabc28536f.tar.bz2
Fixed : LZ4_compress_limitedOutput() bug, as reported by Christopher Speller
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 017d8ae..2ed686b 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -642,10 +642,10 @@ _next_match:
ip += MINMATCH + matchLength;
}
+ if ((outputLimited) && (unlikely(op + (1 + LASTLITERALS) + (matchLength>>8) > olimit)))
+ return 0; /* Check output limit */
if (matchLength>=ML_MASK)
{
- if ((outputLimited) && (unlikely(op + (1 + LASTLITERALS) + (matchLength>>8) > olimit)))
- return 0; /* Check output limit */
*token += ML_MASK;
matchLength -= ML_MASK;
for (; matchLength >= 510 ; matchLength-=510) { *op++ = 255; *op++ = 255; }