diff options
author | Yann Collet <cyan@fb.com> | 2020-09-18 03:59:01 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2020-09-18 03:59:01 (GMT) |
commit | dc27b7ae4157024384b4766e501d9ba2788ddfd3 (patch) | |
tree | 4398c13d7575d4f364cbf978098f02ebed8691f8 /lib/lz4.h | |
parent | d568a6d15cdd06d3f131adaa32299d7535772723 (diff) | |
download | lz4-dc27b7ae4157024384b4766e501d9ba2788ddfd3.zip lz4-dc27b7ae4157024384b4766e501d9ba2788ddfd3.tar.gz lz4-dc27b7ae4157024384b4766e501d9ba2788ddfd3.tar.bz2 |
comment bug on older versions of ZSTD_compress_destSize()
following investigation in #859
Diffstat (limited to 'lib/lz4.h')
-rw-r--r-- | lib/lz4.h | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -213,7 +213,18 @@ LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* src, char* d * New value is necessarily <= input value. * @return : Nb bytes written into 'dst' (necessarily <= targetDestSize) * or 0 if compression fails. -*/ + * + * Note : from v1.8.2 to v1.9.1, this function had a bug (fixed un v1.9.2+): + * the produced compressed content could, in specific circumstances, + * require to be decompressed into a destination buffer larger + * by at least 1 byte than the content to decompress. + * If an application uses `LZ4_compress_destSize()`, + * it's highly recommended to update liblz4 to v1.9.2 or better. + * If this can't be done or ensured, + * the receiving decompression function should provide + * a dstCapacity which is > decompressedSize, by at least 1 byte. + * See https://github.com/lz4/lz4/issues/859 for details + */ LZ4LIB_API int LZ4_compress_destSize (const char* src, char* dst, int* srcSizePtr, int targetDstSize); |