Fixed decompression bug

This commit is contained in:
Yann Collet 2014-11-28 02:48:21 +01:00
parent 2d98faf238
commit e3d1b4e020

9
lz4.c
View File

@ -1033,9 +1033,12 @@ FORCE_INLINE int LZ4_decompress_generic(
if (unlikely(cpy>oend-12))
{
if (cpy > oend-LASTLITERALS) goto _output_error; /* Error : last LASTLITERALS bytes must be literals */
if (op < oend-8) LZ4_wildCopy(op, match, oend-8);
match += oend-8 - op;
op = oend-8;
if (op < oend-8)
{
LZ4_wildCopy(op, match, oend-8);
match += oend-8 - op;
op = oend-8;
}
while (op<cpy) *op++ = *match++;
}
else