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").
This commit is contained in:
Cedric De Brito 2018-07-02 14:35:04 +02:00
parent 1466e0b7f2
commit 98c0c7cf9d

View File

@ -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);