diff options
author | Yann Collet <cyan@fb.com> | 2020-11-08 23:26:19 -0800 |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2020-11-08 23:26:19 -0800 |
commit | 44b13db53201927814a21cd962ad5979745e2d17 (patch) | |
tree | 80efbddc428e41d7b2abcc5ad158cd812daceeff /lib/lz4.c | |
parent | 52646e8d7517b9b399d3e3719c65816afdc833ab (diff) | |
parent | 9cf3f106a8dea906ff4550f749112e9e89536678 (diff) | |
download | lz4-44b13db53201927814a21cd962ad5979745e2d17.tar.gz lz4-44b13db53201927814a21cd962ad5979745e2d17.tar.bz2 lz4-44b13db53201927814a21cd962ad5979745e2d17.zip |
Merge branch 'dev' into customMem
Diffstat (limited to 'lib/lz4.c')
-rw-r--r-- | lib/lz4.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1619,7 +1619,7 @@ int LZ4_compress_fast_continue (LZ4_stream_t* LZ4_stream, * cost to copy the dictionary's tables into the active context, * so that the compression loop is only looking into one table. */ - LZ4_memcpy(streamPtr, streamPtr->dictCtx, sizeof(LZ4_stream_t)); + LZ4_memcpy(streamPtr, streamPtr->dictCtx, sizeof(*streamPtr)); result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingExtDict, noDictIssue, acceleration); } else { result = LZ4_compress_generic(streamPtr, source, dest, inputSize, NULL, maxOutputSize, limitedOutput, tableType, usingDictCtx, noDictIssue, acceleration); @@ -1675,7 +1675,7 @@ int LZ4_saveDict (LZ4_stream_t* LZ4_dict, char* safeBuffer, int dictSize) if ((U32)dictSize > dict->dictSize) { dictSize = (int)dict->dictSize; } if (safeBuffer == NULL) assert(dictSize == 0); - if (safeBuffer != NULL) + if (dictSize > 0) memmove(safeBuffer, previousDictEnd - dictSize, dictSize); dict->dictionary = (const BYTE*)safeBuffer; |