summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/lz4frame.h5
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.