summaryrefslogtreecommitdiffstats
path: root/lib/lz4frame.c
Commit message (Collapse)AuthorAgeFilesLines
* [amalgamation] lz4frame.cBing Xu2018-11-261-0/+7
|
* fixed #589Yann Collet2018-10-091-1/+5
| | | | | | | | 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).
* added a test for LZ4F_compressEnd()Yann Collet2018-10-091-11/+14
| | | | | | | | | | | | | | | 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.
* fixed improper hintYann Collet2018-09-281-3/+5
| | | | | | | | | | | | | 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.
* fixed minor cppcheck warnings in libYann Collet2018-09-181-7/+7
|
* avoid final trailing comma for enum listsYann Collet2018-09-131-5/+5
| | | | | | | as detected in #485 by @JoachimSchneider. Refactored the c_standards tests so that these issues get automatically detected in CI tests.
* Fixed bugs about incorrect acceleration calculation and benchmarking ↵Jennifer Liu2018-06-271-2/+2
| | | | negative compresion level
* small extDict : fixed side-effectYann Collet2018-05-061-0/+1
| | | | | | don't fix dictionaries of size 0. setting dictEnd == source triggers prefix mode, thus removing possibility to use CDict.
* fixed frametest errorYann Collet2018-05-061-0/+1
| | | | | | | | | | | | | | | | | | | | The error can be reproduced using following command : ./frametest -v -i100000000 -s1659 -t31096808 It's actually a bug in the stream LZ4 API, when starting a new stream and providing a first chunk to complete with size < MINMATCH. In which case, the chunk becomes a dictionary. No hash was generated and stored, but the chunk is accessible as default position 0 points to dictStart, and position 0 is still within MAX_DISTANCE. Then, next attempt to read 32-bits from position 0 fails. The issue would have been mitigated by starting from index 64 KB, effectively eliminating position 0 as too far away. The proper fix is to eliminate such "dictionary" as too small. Which is what this patch does.
* Merge pull request #529 from felixhandte/lz4f-fast-reset-for-streaming-onlyYann Collet2018-05-031-5/+14
|\ | | | | LZ4F: Only Reset the LZ4_stream_t when Init'ing a Streaming Block
| * Only Reset the LZ4 Stream when Init'ing a Streaming BlockW. Felix Handte2018-05-031-5/+14
| |
* | random lz4f clarificationsYann Collet2018-05-021-29/+47
|/ | | | | | | | | | | | | | the initial intention was to update lz4f ring buffer strategy, but lz4f doesn't use ring buffer. Instead, it uses the destination buffer as much as possible, and merely copies just what's required to preserve history into its own buffer, at the end. Pretty efficient. This patch just clarifies a few comments and add some assert(). It's built on top of #528. It also updates doc.
* Merge pull request #520 from felixhandte/frame-dict-nitsYann Collet2018-04-271-7/+14
|\ | | | | Minor Fixes to Dictionary Preparation in LZ4 Frame
| * Avoid Possibly Redundant Table Clears When Loading HC DictW. Felix Handte2018-04-271-1/+1
| |
| * Remove Redundant LZ4_resetStream() CallW. Felix Handte2018-04-271-2/+1
| |
| * Rename LZ4F_applyCDict() -> LZ4F_initStream()W. Felix Handte2018-04-271-4/+12
| |
* | Merge pull request #519 from lz4/fdParserYann Collet2018-04-271-0/+3
|\ \ | |/ |/| Faster decoding speed
| * fixed a number of minor cast warningsYann Collet2018-04-271-1/+1
| |
| * fasterDecSpeed can be triggered from cli with --favor-decSpeedYann Collet2018-04-261-1/+1
| |
| * favorDecSpeed feature can be triggered from lz4frameYann Collet2018-04-261-0/+3
| | | | | | | | and lz4hc.
* | Limit Dictionary Size During LZ4F DecompressionW. Felix Handte2018-04-261-4/+21
|/ | | | Fixes lz4/lz4#517.
* Change Over Includes in the ProjectW. Felix Handte2018-04-241-1/+2
|
* Remove Debug Log StatementsW. Felix Handte2018-04-241-21/+0
|
* Add API for Attaching DictionariesW. Felix Handte2018-04-201-2/+1
|
* Use Fast Reset in LZ4F AgainW. Felix Handte2018-04-201-1/+1
|
* Use Fast Reset API in LZ4FW. Felix Handte2018-04-201-1/+1
|
* Call LZ4F_applyCDict Even on NULL CDictW. Felix Handte2018-04-201-1/+1
|
* Set dictCtx Rather than memcpy'ing CtxW. Felix Handte2018-04-201-6/+3
|
* Add Debug Log Statements to HCW. Felix Handte2018-04-201-0/+21
|
* Minor FixesW. Felix Handte2018-04-111-2/+0
|
* Add a LZ4_STATIC_LINKING_ONLY Macro to Guard Experimental APIsW. Felix Handte2018-04-111-0/+1
|
* Expose dictCtx Functionality in LZ4W. Felix Handte2018-04-111-2/+1
|
* Rename _extState_noReset -> _extState_fastReset and Edit CommentsW. Felix Handte2018-04-111-1/+1
|
* Expose a Faster Stream Reset FunctionW. Felix Handte2018-04-101-3/+1
|
* fix comment styleYann Collet2018-03-211-2/+2
|
* Switch ALLOC() to ALLOC_AND_ZERO() to Paper Over Existing Uninitialized ReadW. Felix Handte2018-03-131-1/+1
|
* Split lz4CtxLevel into Two FieldsW. Felix Handte2018-03-131-17/+10
|
* Another Allocation Fail CheckW. Felix Handte2018-03-131-1/+2
|
* Renames and Comment FixesW. Felix Handte2018-03-121-1/+1
|
* Hoist LZ4F Dictionary Setup into Helper LZ4F_applyCDict()W. Felix Handte2018-03-121-47/+25
|
* Minor Style FixesW. Felix Handte2018-03-121-9/+9
|
* Replace calloc() Calls With malloc() Where PossibleW. Felix Handte2018-03-121-15/+16
|
* Make LZ4F_compressFrame_usingCDict Take a Compression ContextW. Felix Handte2018-03-121-22/+53
|
* Set Dictionary Context Pointer Rather than Copying the Context InW. Felix Handte2018-03-121-6/+29
|
* Only Re-Alloc / Reset When Needed When Switching Between Regular and High ↵W. Felix Handte2018-03-121-13/+27
| | | | Compression Modes
* Avoid Resetting the Context When PossibleW. Felix Handte2018-03-121-2/+19
|
* refactored frameCompress exampleYann Collet2018-01-311-1/+2
| | | | to better reflect LZ4F API usage.
* lz4frame : removed some intermediate stage from LZ4F_decompress()Yann Collet2018-01-141-16/+6
| | | | | ensure some strange jump cases are not possible (they were already not possible, but static analyzer couldn't understand it).
* ensure a ptr is non-nullYann Collet2018-01-141-0/+9
| | | | | with an assert() to help static analyzer understanding this condition.
* modified formulation for LZ4F_compressBound()Yann Collet2018-01-141-5/+5
| | | | | | previous version used an intentional overflow, which is defined since it uses unsigned type, but static analyzer complain about it.