summaryrefslogtreecommitdiffstats
path: root/zlib-1.2.7-z-block-flush.patch
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2016-03-30 17:29:18 -0500
committerYaakov Selkowitz <yselkowi@redhat.com>2016-03-30 17:29:18 -0500
commitcc3009e613f3e2c64bd047be05f8332c6042853d (patch)
treec1a03e1bd6f06e28452548e7e42286a0c9506cda /zlib-1.2.7-z-block-flush.patch
parent18c708c3a6042a859865096a49fa7fdb6680bf6b (diff)
downloadcygwin-zlib-cc3009e613f3e2c64bd047be05f8332c6042853d.tar.gz
cygwin-zlib-cc3009e613f3e2c64bd047be05f8332c6042853d.tar.xz
cygwin-zlib-cc3009e613f3e2c64bd047be05f8332c6042853d.zip
Commit missing patches
Diffstat (limited to 'zlib-1.2.7-z-block-flush.patch')
-rw-r--r--zlib-1.2.7-z-block-flush.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/zlib-1.2.7-z-block-flush.patch b/zlib-1.2.7-z-block-flush.patch
new file mode 100644
index 0000000..9bca519
--- /dev/null
+++ b/zlib-1.2.7-z-block-flush.patch
@@ -0,0 +1,45 @@
+From f1b8edadc3c733990f8a8de4d643f968e571ae85 Mon Sep 17 00:00:00 2001
+From: Adam Tkac <atkac@redhat.com>
+Date: Fri, 17 Aug 2012 15:13:48 +0200
+Subject: [PATCH] Rank Z_BLOCK flush below Z_PARTIAL_FLUSH only when last
+ flush was Z_BLOCK.
+
+This fixes regression introduced by f1ebdd6a9c495a5db9a22aa80dd7d54ae7db42e9
+(Permit stronger flushes after Z_BLOCK flushes.). Now this code is valid
+again:
+
+deflate(stream, Z_SYNC_FLUSH);
+deflateParams(stream, newLevel, Z_DEFAULT_STRATEGY);
+
+Signed-off-by: Adam Tkac <atkac@redhat.com>
+---
+ deflate.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/deflate.c b/deflate.c
+index 9e4c2cb..3422f72 100644
+--- a/deflate.c
++++ b/deflate.c
+@@ -882,9 +882,16 @@ int ZEXPORT deflate (strm, flush)
+ * flushes. For repeated and useless calls with Z_FINISH, we keep
+ * returning Z_STREAM_END instead of Z_BUF_ERROR.
+ */
+- } else if (strm->avail_in == 0 && RANK(flush) <= RANK(old_flush) &&
+- flush != Z_FINISH) {
+- ERR_RETURN(strm, Z_BUF_ERROR);
++ } else if (strm->avail_in == 0 && flush != Z_FINISH) {
++ char err;
++
++ /* Degrade Z_BLOCK only when last flush was Z_BLOCK */
++ err = (old_flush == Z_BLOCK) ?
++ RANK(flush) <= RANK(old_flush) : flush <= old_flush;
++
++ if (err) {
++ ERR_RETURN(strm, Z_BUF_ERROR);
++ }
+ }
+
+ /* User must not provide more input after the first FINISH: */
+--
+1.7.11.4
+