aboutsummaryrefslogtreecommitdiff
path: root/old (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-12-26Speed up software CRC-32 computation by a factor of 1.5 to 3.Mark Adler6-1096/+10209
Use the interleaved method of Kadatch and Jenkins in order to make use of pipelined instructions through multiple ALUs in a single core. This also speeds up and simplifies the combination of CRCs, and updates the functions to pre-calculate and use an operator for CRC combination.
2018-11-04Add crc32_combine_gen() and crc32_combine_op() for fast combines.Mark Adler2-0/+97
When the same len2 is used repeatedly, it is faster to use crc32_combine_gen() to generate an operator, that is then used to combine CRCs with crc32_combine_op().
2018-11-03Add tables for crc32_combine(), to speed it up by a factor of 200.Mark Adler2-92/+396
2018-10-14Fix the zran.c example to work on a multiple-member gzip file.Mark Adler3-93/+204
2018-10-07Add gznorm.c example, which normalizes gzip files.Mark Adler2-0/+474
2018-08-05Show all the codes for the maximum tables size in enough.c.Mark Adler1-160/+191
2018-08-05Clarify that prefix codes are counted in enough.c.Mark Adler1-15/+15
There is no assurance that all prefix codes are reachable as optimal Huffman codes for the numbers of symbols encountered in a deflate block. This code considers all possible prefix codes, which might be a larger set than all possible Huffman codes, depending on the constraints.
2018-08-05Use inline function instead of macro for index in enough.c.Mark Adler1-4/+8
2018-08-01Clean up code style in enough.c, update version.Mark Adler1-211/+202
2018-08-01Use a macro for the printf format of big_t in enough.c.Mark Adler1-7/+3
2018-08-01Use a structure to make globals in enough.c evident.Mark Adler1-86/+89
2018-04-19Assure that the number of bits for deflatePrime() is valid.Mark Adler1-1/+2
2018-04-19Fix a bug that can crash deflate on some input when using Z_FIXED.Mark Adler3-70/+79
This bug was reported by Danilo Ramos of Eideticom, Inc. It has lain in wait 13 years before being found! The bug was introduced in zlib 1.2.2.2, with the addition of the Z_FIXED option. That option forces the use of fixed Huffman codes. For rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays. That results in corrupted output due to invalid distances, and can result in out-of-bound accesses, crashing the application. The fix here combines the distance buffer and literal/length buffers into a single symbol buffer. Now three bytes of pending buffer space are opened up for each literal or length/distance pair consumed, instead of the previous two bytes. This assures that the pending buffer cannot overwrite the symbol table, since the maximum fixed code compressed length/distance is 31 bits, and since there are four bytes of pending space for every three bytes of symbol space.
2018-01-31Correct the initialization requirements for deflateInit2().Mark Adler1-2/+1
2018-01-08Emphasize the need to continue decompressing gzip members.Mark Adler1-3/+5
2017-10-12Add legal disclaimer to README.Mark Adler1-1/+4
2017-10-12Fix deflateEnd() to not report an error at start of raw deflate.Mark Adler1-1/+3
2017-10-12Remove old assembler code in which bugs have manifested.Mark Adler18-6172/+0
In addition, there is not sufficient gain from the inflate assembler code to warrant its inclusion.
2017-10-12Make the names in functions declarations identical to definitions.Mark Adler3-6/+6
2017-10-12Avoid an undefined behavior of memcpy() in _tr_stored_block().Mark Adler1-1/+2
Allegedly the behavior of memcpy() is undefined if the source pointer is NULL, even if the number of bytes to copy is zero.
2017-10-12Avoid undefined behaviors of memcpy() in gz*printf().Mark Adler1-2/+2
2017-10-12Avoid an undefined behavior of memcpy() in gzappend().Mark Adler1-1/+1
2017-06-03Avoid the use of ptrdiff_t.Mark Adler2-11/+3
This isn't the right type anyway to assure that it contains a pointer. That type would be intptr_t or uintptr_t. However the C99 standard says that those types are optional, so their use would not be portable. This commit simply uses size_t or whatever configure decided to use for size_t. That would be the same length as ptrdiff_t, and so will work just as well. The code checks to see if the length of the type used is the same as the length of a void pointer, so there is already protection against the use of the wrong type. The use of size_t (or ptrdiff_t) will almost always work, as all modern architectures have an array size that is the same as the pointer size. Only old segmented architectures would have to fall back to the slower CRC-32 calculation, where the amount of memory that can be accessed is larger than the maximum array size.
2017-04-16Handle case where inflateSync used when header never processed.Mark Adler1-0/+2
If zlib and/or gzip header processing was requested, but a header was never provided and inflateSync was used successfully, then the inflate state would be inconsistent, trying to compute a check value but with no flags set. This commit sets the inflate mode to raw in this case, since there is no other assumption that can be made if a header was requested but never seen.
2017-03-30Don't compute check value for raw inflate if asked to validate.Mark Adler1-1/+1
2017-02-18Add address checking in clang to -w option of configure.Mark Adler1-2/+2
2017-02-15Return an error if the gzputs string length can't fit in an int.Mark Adler1-4/+7
2017-02-15Small speedup to inflate [psumbera].Mark Adler1-14/+14
Seeing a few percent speedup by using a pointer instead of an assigned structure. This seems to help the compiler to optimize better.
2017-02-15Update use of errno for newer Windows CE versions.Mark Adler1-2/+2
2017-02-15Avoid some conversion warnings in gzread.c and gzwrite.c.Mark Adler2-8/+6
2017-02-15Have Makefile return non-zero error code on test failure.Mark Adler1-6/+6
2017-02-15Avoid a conversion error in gzseek when off_t type too small.Mark Adler1-2/+2
This is a problem in the odd case that the second argument of LSEEK is a larger type than off_t. Apparently MinGW defines off_t to be 32 bits, but _lseeki64 has a 64-bit second argument. Also undo a previous commit to permit MinGW to use _lseeki64.
2017-02-15Fix CLEAR_HASH macro to be usable as a single statement.Mark Adler1-2/+5
As it is used in deflateParams().
2017-02-15Fix bug when window full in deflate_stored().Mark Adler1-1/+1
2017-02-15Limit hash table inserts after switch from stored deflate.Mark Adler1-1/+9
This limits hash table inserts to the available data in the window and to the sliding window size in deflate_stored(). The hash table inserts are deferred until deflateParams() switches to a non-zero compression level.
2017-02-15Permit a deflateParams() parameter change as soon as possible.Mark Adler2-8/+9
This commit allows a parameter change even if the input data has not all been compressed and copied to the application output buffer, so long as all of the input data has been compressed to the internal pending output buffer. This also allows an immediate deflateParams change so long as there have been no deflate calls since initialization or reset.
2017-01-16Cygwin does not have _wopen(), so do not create gzopen_w() there.Mark Adler2-2/+2
2017-01-15Change version number to 1.2.11.1.Mark Adler25-48/+51
2017-01-15zlib 1.2.11v1.2.11Mark Adler29-54/+58
2017-01-15Permit immediate deflateParams changes before any deflate input.Mark Adler2-5/+7
This permits deflateParams to change the strategy and level right after deflateInit, without having to wait until a header has been written. The parameters can be changed immediately up until the first deflate call that consumes any input data.
2017-01-15Update high water mark in deflate_stored.Mark Adler1-0/+4
This avoids unnecessary filling of bytes in the sliding window buffer when switching from level zero to a non-zero level. This also provides a consistent indication of deflate having taken input for a later commit ...
2017-01-15Update vestigial comment from very old Info-ZIP deflate.Mark Adler1-2/+2
2017-01-15Fix deflate stored bug when pulling last block from window.Mark Adler1-5/+5
And some cosmetic cleanups.
2017-01-15Update location of Visual Studio project files.Mark Adler1-1/+1
2017-01-15Delete user-specific Visual Studio project files.Mark Adler6-24/+0
2017-01-15Change version number to 1.2.10.1.Mark Adler27-53/+53
2017-01-02zlib 1.2.10v1.2.10Mark Adler25-54/+58
2017-01-02Fix compilation with --solo and --debug combined.Mark Adler1-1/+1
However this ends up not really being solo, since it has to include external libraries.
2017-01-02Add warnings when compiling with assembler code.Mark Adler2-1/+4
There have been many reports of bugs in the assembler codes intended to speed up deflate and inflate. They are third-party contributions in contrib, and so are not supported by the zlib maintainers.
2017-01-02Remove files to be installed before copying them in Makefile.in.Mark Adler1-0/+5