diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2014-09-10 12:00:39 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2014-09-10 12:00:39 (GMT) |
commit | 0400451ac22b9578274a3971ed65e6c70cd7fdb9 (patch) | |
tree | 77d33900b431be2047db09d272e2914a8c462453 /lz4.c | |
parent | eac83cd850d2f69a82ef9af344be9b7f3925681a (diff) | |
download | lz4-0400451ac22b9578274a3971ed65e6c70cd7fdb9.zip lz4-0400451ac22b9578274a3971ed65e6c70cd7fdb9.tar.gz lz4-0400451ac22b9578274a3971ed65e6c70cd7fdb9.tar.bz2 |
Fix : streaming mode bug (re-using context & buffers)
Diffstat (limited to 'lz4.c')
-rw-r--r-- | lz4.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -855,7 +855,7 @@ int LZ4_saveDict (LZ4_stream_t* LZ4_dict, char* safeBuffer, int dictSize) if ((U32)dictSize > 64 KB) dictSize = 64 KB; /* useless to define a dictionary > 64 KB */ if ((U32)dictSize > dict->dictSize) dictSize = dict->dictSize; - memcpy(safeBuffer, previousDictEnd - dictSize, dictSize); + memmove(safeBuffer, previousDictEnd - dictSize, dictSize); dict->dictionary = (const BYTE*)safeBuffer; dict->dictSize = (U32)dictSize; @@ -870,9 +870,9 @@ int LZ4_saveDict (LZ4_stream_t* LZ4_dict, char* safeBuffer, int dictSize) ****************************/ /* * This generic decompression function cover all use cases. - * It shall be instanciated several times, using different sets of directives + * It shall be instantiated several times, using different sets of directives * Note that it is essential this generic function is really inlined, - * in order to remove useless branches during compilation optimisation. + * in order to remove useless branches during compilation optimization. */ FORCE_INLINE int LZ4_decompress_generic( const char* source, |