Commits on Source (17)
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
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.
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
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.
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
-
Mark Adler authored
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().
-
Mark Adler authored
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.
-
Mark Adler authored
-
Mark Adler authored
inflateSync() is used to skip invalid deflate data, which means that the check value that was being computed is no longer useful. This commit turns off the check value computation, and furthermore allows a successful return if the compressed data terminated in a graceful manner. This commit also fixes a bug in the case that inflateSync() is used before a header is ever processed. In that case, there is no knowledge of a trailer, so the remainder is treated as raw.
Showing
- configure 14 additions, 19 deletionsconfigure
- crc32.c 855 additions, 302 deletionscrc32.c
- crc32.h 9441 additions, 436 deletionscrc32.h
- deflate.c 55 additions, 20 deletionsdeflate.c
- deflate.h 11 additions, 14 deletionsdeflate.h
- doc/crc-doc.1.0.pdf 0 additions, 0 deletionsdoc/crc-doc.1.0.pdf
- examples/README.examples 5 additions, 0 deletionsexamples/README.examples
- examples/enough.c 385 additions, 360 deletionsexamples/enough.c
- examples/gznorm.c 470 additions, 0 deletionsexamples/gznorm.c
- examples/zran.c 163 additions, 93 deletionsexamples/zran.c
- examples/zran.h 40 additions, 0 deletionsexamples/zran.h
- inflate.c 10 additions, 4 deletionsinflate.c
- inflate.h 2 additions, 1 deletioninflate.h
- test/example.c 2 additions, 3 deletionstest/example.c
- trees.c 14 additions, 36 deletionstrees.c
- zlib.h 27 additions, 6 deletionszlib.h
- zutil.h 11 additions, 0 deletionszutil.h
This diff is collapsed.
This diff is collapsed.
doc/crc-doc.1.0.pdf
0 → 100644
File added
This diff is collapsed.
examples/gznorm.c
0 → 100644
This diff is collapsed.
examples/zran.h
0 → 100644