| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
one less argument
|
|
|
|
|
|
|
|
|
| |
* replace assert with test for LZ4F_uncompressedUpdate
* update documentation to incldue correct docstring
* remove unecessary entry point
* remove compress_linked_block_mode from fuzzing test
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
|
|
|
|
| |
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
|
|
|
|
|
|
|
|
|
|
|
| |
when the block mode changes a flush is executed, to prevent
mixing compressed and uncompressed data.
Prior to this commit dstStart, dstPtr, dstCapacity
where not updated to include the offset from bytesWritten.
For inputs > blockSize this meant the flushed data was
overwritten.
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
|
|
|
|
| |
add static dependency to examples
|
|
|
|
| |
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
|
|
|
|
|
|
| |
add a fuzzing test for uncompressed frame api
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
|
|
|
|
|
|
| |
This commit fixes the review findings
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
|
|
|
|
|
|
|
|
| |
new method `uncompressed_update` allows to insert blocks without
compression into the lz4 stream.
The usage is documented in the frameCompress example
Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
|
|
|
|
|
|
| |
and removed prefix from RETURN_ERROR(_IF)
to improve brevity
as it's just a local macro (no bleeding in user's namespace).
|
| |
|
| |
|
|
|
|
| |
created a new error code in the process : LZ4F_ERROR_compressionState_uninitialized
|
| |
|
|
|
|
|
|
|
| |
ensure that `frametest` works fine with these values,
notably with low LZ4_MEMORY_USAGE (dict test notably)
following suggestions from @t-mat at #1016
|
| |
|
|
|
|
|
|
|
| |
Ensure that the memory block we're trying
to reuse is large enough for the new state.
Fixes #974
|
|
|
|
|
| |
ensure `dictBase` is only used
when there is an actual dictionary content.
|
|
|
|
|
|
| |
now line 912
by ensuring pointer arithmetic is only performed
if there is a reason for an internal buffer to be used.
|
| |
|
|
|
|
|
| |
This is now explicitly documented and asserted.
fix #927
|
|
|
|
| |
fix one (rare & complex) issue discovered by this test
|
| |
|
|
|
|
| |
memcpy() on NULL is UB, even if length is 0.
|
|
|
|
|
| |
detected by scan-build and cppcheck
fix #786
|
|
|
|
| |
properly track history
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
EndMark, the 4-bytes value indicating the end of frame,
must be `0x00000000`.
Previously, it was just mentioned as a `0-size` block.
But such definition could encompass uncompressed blocks of size 0,
with a header of value `0x80000000`.
But the intention was to also support uncompressed empty blocks.
They could be used as a keep-alive signal.
Note that compressed empty blocks are already supported,
it's just that they have a size 1 instead of 0 (for the `0` token).
Unfortunately, the decoder implementation was also wrong,
and would also interpret a `0x80000000` block header as an endMark.
This issue evaded detection so far simply because
this situation never happens, as LZ4Frame always issues
a clean 0x00000000 value as a endMark.
It also does not flush empty blocks.
This is fixed in this PR.
The decoder can now deal with empty uncompressed blocks,
and do not confuse them with EndMark.
The specification is also clarified.
Finally, FrameTest is updated to randomly insert empty blocks during fuzzing.
|
| |
|
| |
|
|
|
|
|
| |
When `FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION` is defined we skip
magic and checksum checks. This makes it easier to fuzz decompression.
|
| |
|
| |
|
| |
|
|
|
|
| |
fix #679, reported by @degski
|
|
|
|
| |
as suggested by @sloutsky in #671
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
since Visual 2017,
worries about potential overflow, which are actually impossible.
Replaced (c * a) by (c ? a : 0).
Will likely replaced a * by a cmov.
Probably harmless for performance.
|
|/
|
|
| |
output can use the full length of output buffer
|
| |
|
|
|
|
|
| |
it is now a pure initializer, for statically allocated states.
It can initialize any memory area, and because of this, requires size.
|
|
|
|
|
|
|
|
|
|
| |
- promoted LZ4_resetStream_fast() to stable
- moved LZ4_resetStream() into deprecate, but without triggering a compiler warning
- update all sources to no longer rely on LZ4_resetStream()
note : LZ4_initStream() proposal is slightly different :
it's able to initialize any buffer, provided that it's large enough.
To this end, it accepts a void*, and returns an LZ4_stream_t*.
|
|
|
|
|
|
|
|
| |
- promoted LZ4_resetStreamHC_fast() to stable
- moved LZ4_resetStreamHC() to deprecated (but do not generate a warning yet)
- Updated doc, to highlight difference between init and reset
- switched all invocations of LZ4_resetStreamHC() onto LZ4_initStreamHC()
- misc: ensure `make all` also builds /tests
|
|
|
|
|
|
|
| |
which remained undetected so far,
as it requires a fairly large number of conditions to be triggered,
starting with enabling Block checksum, which is disabled by default,
and which usage is known to be extremely rare.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
following recommendations by @raggi.
The fix is slightly different, but achieves the same goal,
and is backed by a test tool which proves that it works
(generates the error before the patch, no longer after the patch).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which actively tries to make it write out of bound.
For this scenario to be possible,
it's necessary to set dstCapacity < LZ4F_compressBound()
When a compression operation fails,
the CCtx context is left in an undefined state,
therefore compression cannot resume.
As a consequence :
- round trip tests must be aborted, since there is nothing valid to decompress
- most users avoid this situation, by ensuring that dstCapacity >= LZ4F_compressBound()
For these reasons, this use case was poorly tested up to now.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when LZ4F_decompress() decodes an uncompressed block,
it provides an incorrect hint for next block
when frame checksum is enabled and block checksum is not.
Impact is low : the hint is just an hint,
the decoder works whatever the amount of input provided.
But the assumption that each call to LZ4F_decompress()
would generate just one complete block if input size hint was respected
was broken by this error.
|
| |
|
|
|
|
|
|
|
| |
as detected in #485 by @JoachimSchneider.
Refactored the c_standards tests
so that these issues get automatically detected in CI tests.
|