diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2023-02-07 22:59:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-07 22:59:26 (GMT) |
commit | ecf92d0897587c0f641df9db83c910fd236cb18a (patch) | |
tree | c354004e66d40208287148fa508c88d269aeb6ce /lib | |
parent | 185cf420206cf68a2a5cee8cdaf11145db7cd971 (diff) | |
parent | c3addfea0f457cd7109d17fd32ea029369cdd45e (diff) | |
download | lz4-ecf92d0897587c0f641df9db83c910fd236cb18a.zip lz4-ecf92d0897587c0f641df9db83c910fd236cb18a.tar.gz lz4-ecf92d0897587c0f641df9db83c910fd236cb18a.tar.bz2 |
Merge pull request #1199 from embg/docs
Improve LZ4F_decompress() docs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4frame.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h index 2c356a3..e8ce66d 100644 --- a/lib/lz4frame.h +++ b/lib/lz4frame.h @@ -473,6 +473,11 @@ LZ4F_getFrameInfo(LZ4F_dctx* dctx, * `dstBuffer` can freely change between each consecutive function invocation. * `dstBuffer` content will be overwritten. * + * Note: if `LZ4F_getFrameInfo()` is called before `LZ4F_decompress()`, srcBuffer must be updated to reflect + * the number of bytes consumed after reading the frame header. Failure to update srcBuffer before calling + * `LZ4F_decompress()` will cause decompression failure or, even worse, successful but incorrect decompression. + * See the `LZ4F_getFrameInfo()` docs for details. + * * @return : an hint of how many `srcSize` bytes LZ4F_decompress() expects for next call. * Schematically, it's the size of the current (or remaining) compressed block + header of next block. * Respecting the hint provides some small speed benefit, because it skips intermediate buffers. |