Commit Graph

702 Commits

Author SHA1 Message Date
Mark Adler
3e4aa45834 Add new crc32 functions to z_ prefix defines. 2022-10-05 15:17:52 -07:00
Mark Adler
456775aec8 Add WIN32_LEAN_AND_MEAN for windows.h include. 2022-10-05 15:17:52 -07:00
Mark Adler
4078713e3b Tighten deflateBound bounds.
This improves the non-default expansion from 14% down to 4% in
most cases, and 13% in the remainder.
2022-10-05 15:16:42 -07:00
Mark Adler
7fabcb5357 Fix bug in block type selection when Z_FIXED used.
A fixed block could be chosen when a stored block was smaller. Now
the smaller of the two is always chosen.
2022-10-03 11:42:18 -07:00
Mark Adler
2d6d59e472 Avoid conversion warning in minigzip.c. 2022-10-01 16:52:35 -07:00
Mark Adler
59b948acee Fix typo in contrib readme. 2022-08-28 13:13:17 -07:00
Mark Adler
5752b171fd Fix some typos.
No code changes.
2022-08-23 15:35:13 -07:00
Mark Adler
1eb7682f84 Fix extra field processing bug that dereferences NULL state->head.
The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.
2022-08-08 10:55:40 -07:00
Mark Adler
22aec0cb0b Add -g when debugging with -fsanitize=address to include symbols. 2022-07-31 09:32:43 -07:00
Mark Adler
eff308af42 Fix a bug when getting a gzip header extra field with inflate().
If the extra field was larger than the space the user provided with
inflateGetHeader(), and if multiple calls of inflate() delivered
the extra header data, then there could be a buffer overflow of the
provided space. This commit assures that provided space is not
exceeded.
2022-07-30 15:58:02 -07:00
Mark Adler
b8bd09801f Have infback() deliver all of the available output up to any error. 2022-07-24 11:41:07 -07:00
Mark Adler
2333419cd7 Fix inflateBack to detect invalid input with distances too far. 2022-06-27 12:20:04 -07:00
Mark Adler
7ecf7c7458 Fix odd error in Visual C compiler preventing automatic promotion. 2022-06-04 15:02:40 -07:00
Mark Adler
6c532a8e8a Fix missing ZEXPORT for crc32_combine_op(). 2022-06-04 12:52:13 -07:00
Mark Adler
441a2ac602 Have build test report library version if it doesn't match zlib.h. 2022-05-26 08:47:51 -07:00
Mark Adler
ec3df00224 Correct incorrect inputs provided to the CRC functions.
The previous releases of zlib were not sensitive to incorrect CRC
inputs with bits set above the low 32. This commit restores that
behavior, so that applications with such bugs will continue to
operate as before.
2022-03-30 11:14:53 -07:00
Mark Adler
ce12773790 Fix compile with Windows 10 SDK. (gvollant) 2022-03-28 18:46:59 -07:00
Mark Adler
05796d3d8d Fix configure issue that discarded provided CC definition. 2022-03-28 18:34:10 -07:00
Mark Adler
3df842426b Silence some warnings from Visual Studio C. 2022-03-28 10:50:16 -07:00
Mark Adler
a4c17581d8 Change version number on develop branch to 1.2.12.1. 2022-03-27 18:07:49 -07:00
Mark Adler
21767c654d zlib 1.2.12 2022-03-27 16:05:02 -07:00
Mark Adler
296967c7b7 Fix crc32.c to compile local functions only if used. 2022-03-27 13:48:19 -07:00
Mark Adler
e9a52aa129 Check for cc masquerading as gcc or clang in configure. 2022-03-27 13:47:33 -07:00
Mark Adler
1a1e8da703 Remove destructive aspects of make distclean. 2022-03-27 11:01:50 -07:00
Mark Adler
6847291ea0 Separate out address sanitizing from warnings in configure. 2022-03-27 01:54:17 -07:00
Mark Adler
735eaa1ebd Eliminate use of ULL constants.
0xffffffffffffffffULL was causing warnings for C99 usage. The
suffix for the constant is not necessary anyway, so this commit
removes them.
2022-03-27 01:54:17 -07:00
Mark Adler
76f70abbc7 Add fallthrough comments for gcc.
Note intentional switch case fall throughs to avoid gcc warnings.
2022-03-27 01:54:10 -07:00
Mark Adler
2014a993ad Clean up minizip to reduce warnings for testing.
Also fix Makefile test target and permit added compile options.
2022-01-01 14:55:47 -08:00
Mark Adler
58ca4e57ce Fix unztell64() in minizip to work past 4GB. (Daniël Hörchner)
The issue is that unztell64() does not return the correct value if
the position in the current file (in the ZIP archive) is beyond 4
GB. The cause is that unzReadCurrentFile() does not account for
pfile_in_zip_read_info->stream.total_out at line 1854 of unzip.c
wrapping around (it is a 32-bit variable). So, on line 1860
uTotalOutAfter can be *less* than uTotalOutBefore, propagating the
wraparound to uOutThis, which in turn is added to
pfile_in_zip_read_info->total_out_64. That has the effect of
subtracting 4 GB.
2022-01-01 12:09:30 -08:00
Mark Adler
b135d46eaf minizip warning fix if MAXU32 already defined. (gvollant) 2021-12-31 17:22:37 -08:00
Mark Adler
8678871f18 Replace black/white with allow/block. (theresa-m) 2021-12-31 16:57:07 -08:00
Mark Adler
c3f3043f7a Fix indentation in minizip's zip.c. 2021-07-08 09:32:18 -07:00
Mark Adler
0530dbcef9 Improve portability of contrib/minizip. 2021-02-10 15:03:22 -08:00
Mark Adler
506424c640 Correct typo in blast.c. 2021-01-17 21:50:08 -08:00
Mark Adler
53ce271311 Change macro name in inflate.c to avoid collision in VxWorks. 2020-09-17 11:09:46 -07:00
Mark Adler
e54494e6bc Clarify gz* function interfaces, referring to parameter names. 2020-08-31 12:53:58 -07:00
Mark Adler
d71dc66fa8 Fix error in comment on the polynomial representation of a byte. 2019-07-09 08:55:13 -07:00
Mark Adler
0206436615 Fix memory leak on error in gzlog.c.
Thank you Adam Richter.
2019-05-25 22:23:20 -07:00
Mark Adler
79baebe50e Avoid adding empty gzip member after gzflush with Z_FINISH. 2019-04-13 17:08:50 -07:00
Mark Adler
0e96d8e7c7 Explicitly note that the 32-bit check values are 32 bits. 2019-04-05 15:27:47 -07:00
Mark Adler
deb44b5742 Use ARM crc32 instructions if the ARM architecture has them.
The ARM crc32 instructions will be used only if an architecture is
explicitly specified at compile time that has those instructions.
For example, -march=armv8.1-a or -march=armv8-a+crc, or if the
machine being compiled on has the instructions, -march=native.
2019-02-17 20:49:29 -08:00
Mark Adler
52fc78baf2 Add use of the ARMv8 crc32 instructions when requested.
Define the macro Z_ARM_CRC32 at compile time to use the ARMv8
(aarch64) crc32x and crc32b instructions. This code does not check
for the presence of the crc32 instructions. Those instructions are
optional for ARMv8.0, though mandatory for ARMv8.1 and later. The
use of the crc32 instructions is about ten times as fast as the
software braided calculation of the CRC-32. This can noticeably
speed up the decompression of gzip streams.
2019-02-17 19:48:57 -08:00
Mark Adler
aec89faa2e Correct comment in crc32.c. 2019-02-03 19:54:46 -08:00
Mark Adler
0d36ec47f3 Don't bother computing check value after successful inflateSync().
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.
2019-01-02 20:40:40 -08:00
Mark Adler
7c0c75e990 Use atomic test and set, if available, for dynamic CRC tables. 2018-12-26 13:50:27 -08:00
Mark Adler
f8719f5ae5 Speed up software CRC-32 computation by a factor of 1.5 to 3.
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-12-26 12:26:52 -08:00
Mark Adler
41d86c73b2 Add crc32_combine_gen() and crc32_combine_op() for fast combines.
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-04 10:31:46 -08:00
Mark Adler
47cb412957 Add tables for crc32_combine(), to speed it up by a factor of 200. 2018-11-03 19:45:22 -07:00
Mark Adler
921d81b2a8 Fix the zran.c example to work on a multiple-member gzip file. 2018-10-14 09:57:34 -07:00
Mark Adler
354fa43d12 Add gznorm.c example, which normalizes gzip files. 2018-10-07 13:55:00 -07:00