fix #783
authorYann Collet <cyan@fb.com>
Thu, 27 Aug 2020 07:17:57 +0000 (00:17 -0700)
committerYann Collet <cyan@fb.com>
Thu, 27 Aug 2020 07:17:57 +0000 (00:17 -0700)
commitc5d6f8a8be3927c0bec91bcc58667a6cfad244ad
tree7ace9c0c38600b241a8775381941b9b634bd3f9d
parent3e3a006c6f3337be4298e2c01ba3cb2c0ba04d45
fix #783

LZ4_decompress_safe_partial()
now also supports a scenario where
nb_bytes_to_generate is <= block_decompressed_size
And
nb_bytes_to_read is >= block_compressed_size.

Previously, the only supported scenario was
nb_bytes_to_read == block_compress_size.

Pay attention that,
if nb_bytes_to_read is > block_compressed_size,
then, necessarily, it requires that
nb_bytes_to_generate is <= block_decompress_size.
If both are larger, it will generate corrupted data.
lib/lz4.c
lib/lz4.h
tests/fuzzer.c