]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Add comment about not using windowBits of 8 for deflate().
authorMark Adler <madler@alumni.caltech.edu>
Wed, 29 Jul 2015 04:06:06 +0000 (21:06 -0700)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 3 Nov 2015 14:33:45 +0000 (15:33 +0100)
(cherry picked from commit b56d1c62ee1ff9705026c94a780dd6e4577cda02)

zlib.h

diff --git a/zlib.h b/zlib.h
index d8b41dfc79b03b9fc31f720e482f62fc323d8814..bf906309944ffcf1d00ee4acb50aa31e200c4136 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -541,6 +541,14 @@ ZEXTERN int ZEXPORT deflateInit2 (z_stream *strm,
    compression at the expense of memory usage.  The default value is 15 if
    deflateInit is used instead.
 
+     For the current implementation of deflate(), a windowBits value of 8 (a
+   window size of 256 bytes) is not supported.  As a result, a request for 8
+   will result in 9 (a 512-byte window).  In that case, providing 8 to
+   inflateInit2() will result in an error when the zlib header with 9 is
+   checked against the initialization of inflate().  The remedy is to not use 8
+   with deflateInit2() with this initialization, or at least in that case use 9
+   with inflateInit2().
+
      windowBits can also be -8..-15 for raw deflate.  In this case, -windowBits
    determines the window size.  deflate() will then generate raw deflate data
    with no zlib header or trailer, and will not compute an adler32 check value.