aboutsummaryrefslogtreecommitdiff
path: root/trees.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add deflateUsed() function to get the used bits in the last byte.Mark Adler2024-07-011-0/+2
| | | | | This returns the number of used bits in the last byte of a stream that has just been compressed with deflate.
* Avoid implicit conversion warnings in deflate.c and trees.c.Levi Broderick2024-01-231-1/+1
|
* zlib 1.3.1v1.3.1masterMark Adler2024-01-221-1/+1
|
* Fix pending buffer overflow assert with LIT_MEM allocation.Hans Wennborg2024-01-131-1/+1
| | | | | | | Since each element in s->d_buf is 2 bytes, the sx index should be multiplied by 2 in the assert. Fixes #897
* Add LIT_MEM define to use more memory for a small deflate speedup.Mark Adler2023-09-211-2/+16
| | | | | | | | | A bug fix in zlib 1.2.12 resulted in a slight slowdown (1-2%) of deflate. This commit provides the option to #define LIT_MEM, which uses more memory to reverse most of that slowdown. The memory for the pending buffer and symbol buffers is increased by 25%, which increases the total memory usage with the default parameters by about 6%.
* Remove K&R function definitions from zlib.Mark Adler2023-04-151-302/+224
| | | | | | | C2X has removed K&R definitions from the C function syntax. Though the standard has not yet been approved, some high-profile compilers are now issuing warnings when such definitions are encountered.
* Minor formatting improvements.Mark Adler2022-10-051-52/+52
| | | | No code changes.
* Fix bug in block type selection when Z_FIXED used.Mark Adler2022-10-031-6/+5
| | | | | A fixed block could be chosen when a stored block was smaller. Now the smaller of the two is always chosen.
* Fix some typos.Mark Adler2022-08-231-1/+1
| | | | No code changes.
* Silence some warnings from Visual Studio C.Mark Adler2022-03-281-3/+3
|
* zlib 1.2.12v1.2.12Mark Adler2022-03-271-1/+1
|
* Replace black/white with allow/block. (theresa-m)Mark Adler2021-12-311-9/+9
|
* Fix a bug that can crash deflate on some input when using Z_FIXED.Mark Adler2018-04-191-36/+14
| | | | | | | | | | | | | | | | | | | | | 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.
* Make the names in functions declarations identical to definitions.Mark Adler2017-10-121-1/+1
|
* Avoid an undefined behavior of memcpy() in _tr_stored_block().Mark Adler2017-10-121-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.
* Update vestigial comment from very old Info-ZIP deflate.Mark Adler2017-01-151-2/+2
|
* zlib 1.2.9v1.2.9Mark Adler2016-12-311-1/+1
|
* Avoid some random compiler warnings on various platforms.Mark Adler2016-12-301-1/+1
|
* Increase verbosity required to warn about bit length overflow.Mark Adler2016-12-041-2/+2
| | | | | | | When debugging the Huffman coding would warn about resulting codes greater than 15 bits in length. This is handled properly, and is not uncommon. This increases the verbosity of the warning by one, so that it is not displayed by default.
* Use memcpy for stored blocks.Mark Adler2016-12-041-30/+7
| | | | | | | | | This speeds up level 0 by about a factor of three, as compared to the previous byte-at-a-time loop. We can do much better though. A later commit avoids this copy for level 0 with large buffers, instead copying directly from the input to the output. This commit still speeds up storing incompressible data found when compressing normally.
* Clean up type conversions.Mark Adler2016-10-111-10/+10
|
* Use const for static tree descriptions in deflate.Mark Adler2015-08-151-3/+3
| | | | This is in order to permit shared memory for these structures.
* Avoid use of DEBUG macro -- change to ZLIB_DEBUG.Mark Adler2015-07-281-16/+16
|
* Clean up the usage of z_const and respect const usage within zlib.Mark Adler2012-08-131-6/+8
| | | | | | | | | This patch allows zlib to compile cleanly with the -Wcast-qual gcc warning enabled, but only if ZLIB_CONST is defined, which adds const to next_in and msg in z_stream and in the in_func prototype. A --const option is added to ./configure which adds -DZLIB_CONST to the compile flags, and adds -Wcast-qual to the compile flags when ZLIBGCCWARN is set in the environment.
* Write out all of the available bits when using Z_BLOCK.Mark Adler2012-01-071-0/+9
| | | | | | | | Previously, the bit buffer would hold 1 to 16 bits after "all" of the output is provided after a Z_BLOCK deflate() call. Now at most seven bits remain in the output buffer after Z_BLOCK. flush_pending() now flushes the bit buffer before copying out the byte buffer, in order for it to really flush as much as possible.
* Remove second empty static block for Z_PARTIAL_FLUSH.Mark Adler2012-01-071-24/+0
| | | | | | | | | Z_PARTIAL_FLUSH would sometimes emit two empty static blocks instead of one in order to provide enough lookahead for inflate to be able to decode what was last compressed. inflate no longer needs that much lookahead, so this removes the possibility of emitting the second empty static block. Z_PARTIAL_FLUSH will now emit only one empty static block.
* Allow deflatePrime() to insert bits in the middle of a stream.Mark Adler2012-01-071-6/+1
| | | | | This allows the insertion of multiple empty static blocks for the purpose of efficiently bringing a stream to a byte boundary.
* zlib 1.2.5v1.2.5Mark Adler2011-09-091-3/+4
|
* zlib 1.2.4.5v1.2.4.5Mark Adler2011-09-091-5/+5
|
* zlib 1.2.4-pre1v1.2.4-pre1Mark Adler2011-09-091-10/+10
|
* zlib 1.2.3.4v1.2.3.4Mark Adler2011-09-091-5/+5
|
* zlib 1.2.3.1v1.2.3.1Mark Adler2011-09-091-15/+39
|
* zlib 1.2.2.4v1.2.2.4Mark Adler2011-09-091-2/+2
|
* zlib 1.2.2.2v1.2.2.2Mark Adler2011-09-091-17/+1
|
* zlib 1.2.2.1v1.2.2.1Mark Adler2011-09-091-14/+34
|
* zlib 1.2.1.2v1.2.1.2Mark Adler2011-09-091-2/+2
|
* zlib 1.2.0.7v1.2.0.7Mark Adler2011-09-091-1/+2
|
* zlib 1.2.0.1v1.2.0.1Mark Adler2011-09-091-38/+38
|
* zlib 1.2.0v1.2.0Mark Adler2011-09-091-4/+4
|
* zlib 1.1.4v1.1.4Mark Adler2011-09-091-1/+1
|
* zlib 1.1.3v1.1.3Mark Adler2011-09-091-27/+25
|
* zlib 1.1.1v1.1.1Mark Adler2011-09-091-1/+3
|
* zlib 1.1.0v1.1.0Mark Adler2011-09-091-19/+12
|
* zlib 1.0.8v1.0.8Mark Adler2011-09-091-16/+96
|
* zlib 1.0.7v1.0.7Mark Adler2011-09-091-9/+9
|
* zlib 1.0.4v1.0.4Mark Adler2011-09-091-2/+2
|
* zlib 1.0.2v1.0.2Mark Adler2011-09-091-1/+1
|
* zlib 1.0.1v1.0.1Mark Adler2011-09-091-18/+18
|
* zlib 1.0-prev1.0-preMark Adler2011-09-091-17/+17
|
* zlib 0.99v0.99Mark Adler2011-09-091-60/+74
|