summaryrefslogtreecommitdiffstats
path: root/lz4.c
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-11-03 21:04:19 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-11-03 21:04:19 (GMT)
commit5cc3efc2a5309b0047a80c9eff4675d38a11201d (patch)
tree330685909ae8def9b3a1ac32c44bcc7350fe9d05 /lz4.c
parent206f5f48cf4db19dad3de3adca1d95db335555e0 (diff)
downloadlz4-5cc3efc2a5309b0047a80c9eff4675d38a11201d.zip
lz4-5cc3efc2a5309b0047a80c9eff4675d38a11201d.tar.gz
lz4-5cc3efc2a5309b0047a80c9eff4675d38a11201d.tar.bz2
Corrected issue 38 : bench.c compilation for Sun Solaris 32 bits
Corrected issue 40 : Detect early ending of compressed stream. Thanks Adrian Grand. Corrected issue 41 : minor comment editing on lz4.h git-svn-id: https://lz4.googlecode.com/svn/trunk@82 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'lz4.c')
-rw-r--r--lz4.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lz4.c b/lz4.c
index 18c4604..3e472a4 100644
--- a/lz4.c
+++ b/lz4.c
@@ -719,10 +719,10 @@ int LZ4_uncompress(const char* source,
cpy = op+length;
if unlikely(cpy>oend-COPYLENGTH)
{
- if (cpy > oend) goto _output_error; // Error : request to write beyond destination buffer
+ if (cpy != oend) goto _output_error; // Error : we must necessarily stand at EOF
memcpy(op, ip, length);
ip += length;
- break; // Necessarily EOF
+ break; // EOF
}
LZ4_WILDCOPY(ip, op, cpy); ip -= (op-cpy); op = cpy;
@@ -805,13 +805,13 @@ int LZ4_uncompress_unknownOutputSize(
cpy = op+length;
if ((cpy>oend-COPYLENGTH) || (ip+length>iend-COPYLENGTH))
{
- if (cpy > oend) goto _output_error; // Error : request to write beyond destination buffer
+ if (cpy != oend) goto _output_error; // Error : we must necessarily stand at EOF
if (ip+length > iend) goto _output_error; // Error : request to read beyond source buffer
memcpy(op, ip, length);
op += length;
ip += length;
if (ip<iend) goto _output_error; // Error : LZ4 format violation
- break; // Necessarily EOF, due to parsing restrictions
+ break; // Necessarily EOF, due to parsing restrictions
}
LZ4_WILDCOPY(ip, op, cpy); ip -= (op-cpy); op = cpy;