Mark Adler
6ed77c4885
Leave the stream position unchanged when gzseek() fails.
2026-09-20 18:01:14 -07:00
Mark Adler
6995c67bd4
Avoid signed-overflow undefined behaviors in gzseek.
2026-09-20 17:41:22 -07:00
Mark Adler
d81c2d7eb7
Honor gzprintf's all-or-nothing-written contract when blocked.
2026-09-16 19:44:59 -07:00
Jonathan Gray
51b2667cb4
Correct errno symbol in zlib.h comment.
2026-03-27 16:21:55 -07:00
Mark Adler
dd625a9dfb
Change version number on develop branch to 1.3.2.1.
2026-02-17 14:12:15 -08:00
Mark Adler
9e35567064
Version 1.3.2
2026-02-17 04:47:06 -08:00
Mark Adler
81c41dd5c5
Fix the usage of types in deflate.c for when an int is 16 bits.
...
Also clean up conversion warnings.
2026-02-09 16:34:03 -08:00
Mark Adler
4edb00de5a
Add _z versions of the compress and uncompress functions.
...
Provide size_t arguments for Windows, on which a long is 32 bits.
2026-01-12 10:13:28 -08:00
Mark Adler
916dc1ac35
Add compressBound_z and deflateBound_z functions for large values.
...
These take and return size_t integers, instead of unsigned longs,
for those platforms with 32-bit longs. This commit also assures
that overflows of either integer type results in the maximum value
for that type, instead of wrapping to small values.
2026-01-05 15:03:04 -06:00
Mark Adler
fd366384cf
Prevent the use of insecure functions without an explicit request.
...
ZLIB_INSECURE must be defined in order to compile code that uses
the insecure functions vsprintf() or sprintf(). This would occur
only if the standard vsnprintf() or snprintf() functions are not
available. Providing the --insecure option to ./configure will
define ZLIB_INSECURE. A flag is added to zlibCompileFlags() to
indicate that gzprintf() is not implemented due to the need for
the use of an insecure function, but ZLIB_INSECURE was not
defined.
2026-01-05 15:03:04 -06:00
Mark Adler
ba829a4585
Check for negative lengths in crc32_combine functions.
...
Though zlib.h says that len2 must be non-negative, this avoids the
possibility of an accidental infinite loop.
2026-01-05 15:03:04 -06:00
Mark Adler
570720b0c2
zlib 1.3.1.2
...
Interim version for an audit.
2025-12-08 05:30:18 -08:00
Mark Adler
81cc0bebed
Support non-blocking devices in the gz* routines.
2025-12-08 03:52:25 -08:00
Mark Adler
370ef1b41f
Return all available uncompressed data on error in gzread.c.
...
The error is recorded, and will be detected by the application
after all of the uncompressed data has been consumed and then one
more call is made to read data. The error is available immediately
from gzerror() if the application would like to know earlier.
2025-12-06 19:56:13 -08:00
Mark Adler
9702c9d64e
Update links to the RFCs.
2025-12-06 17:39:45 -08:00
Mark Adler
3e8e4bb5b2
Clarify the use of inflateGetHeader().
2025-12-06 17:39:45 -08:00
Mark Adler
1ab1026a20
Add a "G" option to force gzip, disabling transparency in gzread().
...
If the input is not a gzip stream with this option, an error will
be returned.
2025-12-06 17:39:14 -08:00
Mark Adler
473f78532a
Fix bug in inflatePrime() for 16-bit ints.
...
Also elaborate on the inflatePrime() error return in zlib.h, and
assure that data_type is correct after initialization and a
Z_NEED_DICT return.
2025-05-13 18:00:03 -07:00
Mark Adler
a9bb8c48d7
Note the use of gzungetc() to run a deferred seek while reading.
2025-05-13 18:00:03 -07:00
Mark Adler
aaf94f387d
Note that gzseek() requests are deferred until the next operation.
2025-05-13 18:00:03 -07:00
Mark Adler
aeab3f6cc7
Clarify the use of errnum in gzerror().
2025-02-25 00:31:37 -08:00
Mark Adler
4d1c7207ff
Remove some unsightly spaces in zlib.h.
2025-02-21 13:53:05 -08:00
Vollstrecker
5a82f71ed1
Use generated zconf.h in cmake build.
...
This restores the inclusion of the local zconf.h (double quoted)
in normal usage.
2025-02-18 15:00:15 -08:00
Vollstrecker
00161eff1d
Do not look for zconf.h in the source directory.
...
Temporary patch for cmake, but too violent. A better solution will
need to be found.
2025-02-13 11:51:26 -08:00
Mark Adler
e011d8c164
Add deflateUsed() function to get the used bits in the last byte.
...
This returns the number of used bits in the last byte of a stream
that has just been compressed with deflate.
2024-07-01 19:34:40 -05:00
Mark Adler
0f3b7b9595
Correct typo in zlib.h comment.
2024-05-16 19:07:00 -07:00
Mark Adler
5c42a230b7
Correct argument types for 64-bit combine functions.
2024-02-11 15:42:08 -08:00
Mark Adler
96d3e9e3dd
Expand on the deflate strategy parameter in zlib.h.
2024-02-07 10:48:55 -08:00
Mark Adler
9f0f2d4f9f
Change version number on develop branch to 1.3.1.1.
2024-01-22 13:07:41 -08:00
Mark Adler
51b7f2abda
zlib 1.3.1
2024-01-22 10:32:37 -08:00
Mark Adler
36e369e1a5
Note that the len2 argument of crc_combine*() must be non-negative.
...
If it is negative, then the code will enter an infinite loop.
2024-01-13 22:30:30 -08:00
Paul Ivanov
643e17b749
Correct repeated words in source file comments and a readme.
2023-11-14 18:44:32 -08:00
Mark Adler
3a98b57e55
Change version number on develop branch to 1.3.0.1.
2023-08-18 13:23:07 -07:00
Mark Adler
09155eaa2f
zlib 1.3
2023-08-18 01:45:36 -07:00
Mark Adler
22fc20898b
Clarify requirement in zlib.h to avoid multiple flush markers.
2023-08-17 17:11:11 -07:00
Mark Adler
a88f727dbe
Document in zlib.h the initialization of stream fields by the Init
...
and Reset functions.
2023-07-10 11:27:50 -07:00
Mark Adler
263a982866
Correct comment in zlib.h on os setting in gzip header.
...
The comment said that the os is set to 255, when in fact it has
been set to the current os since zlib 1.2.3. Or at least our best
guess at the os made at compile time.
2023-05-16 20:28:59 -07:00
Paul Marquess
48c3741002
Remove duplicate "the" in zlib.h.
2023-05-01 14:06:43 -07:00
Mark Adler
e9d5486e66
Remove K&R function definitions from zlib.
...
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.
2023-04-15 21:17:31 -07:00
Mark Adler
41fda48fc2
Change version number on develop branch to 1.2.13.1.
2022-10-15 09:02:21 -07:00
Mark Adler
04f42ceca4
zlib 1.2.13
2022-10-12 22:06:55 -07:00
Mark Adler
84c6716a48
Minor formatting improvements.
...
No code changes.
2022-10-05 15:17:52 -07:00
Mark Adler
5752b171fd
Fix some typos.
...
No code changes.
2022-08-23 15:35:13 -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
e54494e6bc
Clarify gz* function interfaces, referring to parameter names.
2020-08-31 12:53:58 -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
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
e99813dbfe
Correct the initialization requirements for deflateInit2().
2018-01-31 13:24:12 -08:00