summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge pull request #504 from baruchsiach/static-only-supportYann Collet2018-04-241-0/+5
|\ \ \ | | | | | | | | lib: allow to disable shared libraries
| * | | lib: allow to disable shared librariesBaruch Siach2018-04-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Just like BUILD_STATIC=no disables static libraries, BUILD_SHARED=no disabled shared libraries. This is useful to support toolchains that do not support shared libraries.
* | | | Merge pull request #507 from lz4/clangPerfYann Collet2018-04-231-5/+11
|\ \ \ \ | |_|/ / |/| | | fixed lz4_fast clang performance
| * | | fixed incorrect commentCyan49732018-04-211-3/+3
| | | |
| * | | fixed clang performance in lz4_fastYann Collet2018-04-211-3/+9
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The simple change from `matchIndex+MAX_DISTANCE < current` towards `current - matchIndex > MAX_DISTANCE` is enough to generate a 10% performance drop under clang. Quite massive. (I missed as my eyes were concentrated on gcc performance at that time). The second version is more robust, because it also survives a situation where `matchIndex > current` due to overflows. The first version requires matchIndex to not overflow. Hence were added `assert()` conditions. The only case where this can happen is with dictCtx compression, in the case where the dictionary context is not initialized before loading the dictionary. So it's enough to always initialize the context while loading the dictionary.
* | | Fix compilation error and assert.Nick Terrell2018-04-231-1/+1
| | |
* | | Fix input size validation edge casesNick Terrell2018-04-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug is a read up to 2 bytes past the end of the buffer. There are three cases for this bug, one for each test case added. * An empty input causes `token = *ip++` to read one byte too far. * A one byte input with `(token >> ML_BITS) == RUN_MASK` causes one extra byte to be read without validation. This could be combined with the first bug to cause 2 extra bytes to be read. * The case pointed out in issue #508, where `ip == iend` at the beginning of the loop after taking the shortcut. Benchmarks show no regressions on clang or gcc-7 on both my mac and devserver. Fixes #508.
* | | lz4.h: clarify the risks of using LZ4_decompress_fast()Alexey Tourbin2018-04-221-5/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | The notes about "security guarantee" and "malicious inputs" seemed a bit non-technical to me, so I took the liberty to tone them down and instead describe the actual risks in technical terms. Namely, the function never writes past the end of the output buffer, so a direct hostile takeover (resulting in arbitrary code execution soon after the return from the function) is not possible. However, the application can crash because of reads from unmapped pages. I also took the liberty to describe what I believe is the only sensible usage scenario for the function: "This function is only usable if the originalSize of uncompressed data is known in advance," etc.
* | Merge pull request #503 from lz4/l120Yann Collet2018-04-193-45/+103
|\ \ | | | | | | minor length reduction of several large lines
| * | modified indentation for consistencyYann Collet2018-04-191-17/+33
| | |
| * | minor length reduction of several large linesYann Collet2018-04-183-44/+86
| |/
* | Merge pull request #502 from lhacc1/devYann Collet2018-04-191-0/+4
|\ \ | |/ |/| Wrap likely/unlikely macroses with #ifndef
| * Wrap likely/unlikely macroses with #ifndefDmitrii Rodionov2018-04-181-0/+4
| | | | | | | | | | It prevent redefine error when project using lz4 has its own likely/unlikely macroses.
* | fixed LZ4_compress_fast_extState_fastReset() in 32-bit modeYann Collet2018-04-171-2/+2
| |
* | fix dictDelta setting errorYann Collet2018-04-171-1/+1
| | | | | | | | wrong test
* | fix matchIndex overflowYann Collet2018-04-171-12/+4
| | | | | | | | can happen with dictCtx
* | Merge branch 'dev' into lowAddrYann Collet2018-04-171-2/+9
|\ \ | |/
| * Always Bump Offset by 64 KB in LZ4_loadDict()W. Felix Handte2018-04-171-2/+9
| | | | | | | | | | This actually ensures the guarantee referred to in the comment in LZ4_compress_fast_continue().
* | fixed dictCtx compressionYann Collet2018-04-171-7/+12
| |
* | edited a few traces for debuggingYann Collet2018-04-171-7/+7
| |
* | fixed minor format warningsYann Collet2018-04-161-3/+3
| |
* | fixed gcc performance regressionYann Collet2018-04-161-2/+4
| |
* | fixed minor unused variable warningYann Collet2018-04-131-3/+0
| |
* | added comment on variables required after _next_matchYann Collet2018-04-131-0/+8
| |
* | fixed potential ptrdiff_t overflow (32-bits mode)Yann Collet2018-04-131-14/+11
| | | | | | | | Also removed pointer comparison, which should solve #485
* | compatibility with gcc-4.4 string.h versionCyan49732018-04-131-3/+3
| | | | | | | | | | | | | | Someone found it would be a great idea to define there a global variable under the very generic name "index". Cause problem with shadow warnings, so no variable can be named "index" now ... Also : automatically update API manual
* | fixed : counting matches which overlap extDict and prefixtest49732018-04-121-10/+17
| |
* | modified a few traces for debugtest49732018-04-122-6/+6
| |
* | fixed LZ4_compress_fast_extState_fastReset()test49732018-04-111-8/+7
| |
* | Merge branch 'dev' into lowAddrtest49732018-04-113-67/+121
|\ \ | |/
| * Fix Silly Warning (const-ness in declaration has no effect on value types!)W. Felix Handte2018-04-111-1/+1
| |
| * Minor FixesW. Felix Handte2018-04-112-11/+13
| |
| * Add a LZ4_STATIC_LINKING_ONLY Macro to Guard Experimental APIsW. Felix Handte2018-04-113-0/+4
| |
| * Expose dictCtx Functionality in LZ4W. Felix Handte2018-04-113-2/+33
| |
| * Rename _extState_noReset -> _extState_fastReset and Edit CommentsW. Felix Handte2018-04-113-27/+41
| |
| * Remove Extraneous Assignment (clearedTable == 0)W. Felix Handte2018-04-111-1/+0
| |
| * Expose a Faster Stream Reset FunctionW. Felix Handte2018-04-103-28/+37
| |
| * Avoid Calling LZ4_prepareTable() in LZ4_compress_fast_continue()W. Felix Handte2018-04-091-20/+14
| |
* | fixed minor conversion warningtest49732018-04-101-1/+2
| | | | | | | | ptr diff -> U32
* | Merge branch 'dev' into lowAddrtest49732018-04-091-21/+17
|\ \ | |/
| * Return to Allowing Early Returns in LZ4_compress_generic()W. Felix Handte2018-04-061-21/+17
| | | | | | | | | | | | Or: `goto` Considered Harmful Or: https://xkcd.com/292/
* | noticed a bug when re-using hash tabletest49732018-04-061-3/+4
| | | | | | | | ./fuzzer -vv -s4217 -t7518
* | fixed byPtr modetest49732018-04-061-22/+25
| | | | | | | | | | | | switch to byU32 when src address is < 64K note : byPtr is still useful in 32-bits, as it's about ~10% faster
* | fixed byPtr match searchtest49732018-04-061-1/+2
| |
* | fixed immediate match searchtest49732018-04-061-7/+5
| |
* | changed LZ4_compress_generic() logictest49732018-04-051-70/+100
| | | | | | | | | | | | to use indexes (U32) instead of Ptr. byPtr is still present.
* | fixed lz4 compression starting at small addresstest49732018-04-051-3/+67
| | | | | | | | when using byU32 and byU16 modes
* | Merge branch 'dev' into lowAddrtest49732018-04-049-612/+851
|\ \ | |/
| * Merge pull request #487 from felixhandte/better-obsoletion-commentYann Collet2018-03-211-6/+10
| |\ | | | | | | Better Describe Functionality of Obsolete Streaming Functions
| | * Also Fix a CommentW. Felix Handte2018-03-211-1/+1
| | |