summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCedric De Brito <cdebrito@nvidia.com>2018-07-02 14:35:04 +0200
committerCedric De Brito <cdebrito@nvidia.com>2018-07-02 14:35:04 +0200
commit98c0c7cf9d0f2429d01e614ebd1d63a6b356f31f (patch)
tree688b5944c581dd686d82128533e56fc1556c636d /examples
parent1466e0b7f29176a1c1792ecc28fa64e29d5aaa69 (diff)
downloadlz4-98c0c7cf9d0f2429d01e614ebd1d63a6b356f31f.tar.gz
lz4-98c0c7cf9d0f2429d01e614ebd1d63a6b356f31f.tar.bz2
lz4-98c0c7cf9d0f2429d01e614ebd1d63a6b356f31f.zip
Fix bug in frame decompress example
The decompression was failing as the srcEnd pointer in decompress_file_internal was wrongly computed beyond the end of the memory block. We need to account for the fact that the header ("info") was already read in the calling function ("alreadyConsumed").
Diffstat (limited to 'examples')
-rw-r--r--examples/frameCompress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/frameCompress.c b/examples/frameCompress.c
index 9bfea48..0f8910d 100644
--- a/examples/frameCompress.c
+++ b/examples/frameCompress.c
@@ -260,7 +260,7 @@ decompress_file_allocDst(FILE* f_in, FILE* f_out,
int const decompressionResult = decompress_file_internal(
f_in, f_out,
dctx,
- src, srcCapacity, readSize, consumedSize,
+ src, srcCapacity, readSize-consumedSize, consumedSize,
dst, dstCapacity);
free(dst);