diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2015-07-28 21:06:06 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2015-07-28 21:06:06 -0700 |
commit | b56d1c62ee1ff9705026c94a780dd6e4577cda02 (patch) | |
tree | f4103f34f3d24915f8abd8939394abf63198b45b | |
parent | e7ebb399d7a7ef9fd88c8fb194f943169fdaa346 (diff) | |
download | zlib-b56d1c62ee1ff9705026c94a780dd6e4577cda02.tar.gz zlib-b56d1c62ee1ff9705026c94a780dd6e4577cda02.tar.bz2 zlib-b56d1c62ee1ff9705026c94a780dd6e4577cda02.zip |
Add comment about not using windowBits of 8 for deflate().
-rw-r--r-- | zlib.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -544,6 +544,14 @@ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, | |||
544 | compression at the expense of memory usage. The default value is 15 if | 544 | compression at the expense of memory usage. The default value is 15 if |
545 | deflateInit is used instead. | 545 | deflateInit is used instead. |
546 | 546 | ||
547 | For the current implementation of deflate(), a windowBits value of 8 (a | ||
548 | window size of 256 bytes) is not supported. As a result, a request for 8 | ||
549 | will result in 9 (a 512-byte window). In that case, providing 8 to | ||
550 | inflateInit2() will result in an error when the zlib header with 9 is | ||
551 | checked against the initialization of inflate(). The remedy is to not use 8 | ||
552 | with deflateInit2() with this initialization, or at least in that case use 9 | ||
553 | with inflateInit2(). | ||
554 | |||
547 | windowBits can also be -8..-15 for raw deflate. In this case, -windowBits | 555 | windowBits can also be -8..-15 for raw deflate. In this case, -windowBits |
548 | determines the window size. deflate() will then generate raw deflate data | 556 | determines the window size. deflate() will then generate raw deflate data |
549 | with no zlib header or trailer, and will not compute an adler32 check value. | 557 | with no zlib header or trailer, and will not compute an adler32 check value. |