diff options
author | Yann Collet <cyan@fb.com> | 2018-04-17 23:47:56 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2018-04-17 23:47:56 (GMT) |
commit | 5ad4599c5ad18d2408a6ccc545c45a36b99f0c6f (patch) | |
tree | 24b53a0b402c8e34955f2321b98036af3bdc37a7 /lib | |
parent | 88cca1723e76c8f5031954ba07b28447c0cb55d8 (diff) | |
download | lz4-5ad4599c5ad18d2408a6ccc545c45a36b99f0c6f.zip lz4-5ad4599c5ad18d2408a6ccc545c45a36b99f0c6f.tar.gz lz4-5ad4599c5ad18d2408a6ccc545c45a36b99f0c6f.tar.bz2 |
fixed LZ4_compress_fast_extState_fastReset() in 32-bit mode
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -983,7 +983,7 @@ int LZ4_compress_fast_extState_fastReset(void* state, const char* src, char* dst return LZ4_compress_generic(ctx, src, dst, srcSize, 0, notLimited, tableType, noDict, noDictIssue, acceleration); } } else { - const tableType_t tableType = (sizeof(void*)==8) ? byU32 : byPtr; + const tableType_t tableType = ((sizeof(void*)==4) && ((uptrval)src > MAX_DISTANCE)) ? byPtr : byU32; LZ4_prepareTable(ctx, srcSize, tableType); return LZ4_compress_generic(ctx, src, dst, srcSize, 0, notLimited, tableType, noDict, noDictIssue, acceleration); } @@ -997,7 +997,7 @@ int LZ4_compress_fast_extState_fastReset(void* state, const char* src, char* dst return LZ4_compress_generic(ctx, src, dst, srcSize, dstCapacity, limitedOutput, tableType, noDict, noDictIssue, acceleration); } } else { - const tableType_t tableType = (sizeof(void*)==8) ? byU32 : byPtr; + const tableType_t tableType = ((sizeof(void*)==4) && ((uptrval)src > MAX_DISTANCE)) ? byPtr : byU32; LZ4_prepareTable(ctx, srcSize, tableType); return LZ4_compress_generic(ctx, src, dst, srcSize, dstCapacity, limitedOutput, tableType, noDict, noDictIssue, acceleration); } |