[zlib] - resolves: #844791 rank Z_BLOCK flush below Z_PARTIAL_FLUSH only when last flush was Z_BLOCK

pschiffe pschiffe at fedoraproject.org
Thu Aug 23 10:29:29 UTC 2012


commit 4f28307ec2b52ffc7aa3e3e4fe93403274dc4c4c
Author: Peter Schiffer <pschiffe at redhat.com>
Date:   Wed Aug 22 16:55:07 2012 +0200

    - resolves: #844791
      rank Z_BLOCK flush below Z_PARTIAL_FLUSH only when last flush was Z_BLOCK

 zlib-1.2.7-z-block-flush.patch |   36 ++++++++++++++++++++++++++++++++++++
 zlib.spec                      |    8 +++++++-
 2 files changed, 43 insertions(+), 1 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..9bd8a4b
--- /dev/null
+++ b/zlib-1.2.7-z-block-flush.patch
@@ -0,0 +1,36 @@
+From 27a4fb5e54884c06fc0face8b4b432fa06dce773 Mon Sep 17 00:00:00 2001
+From: Adam Tkac <atkac at 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 at redhat.com>
+---
+ deflate.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/deflate.c b/deflate.c
+index 9e4c2cb..d1d0c68 100644
+--- a/deflate.c
++++ b/deflate.c
+@@ -882,8 +882,8 @@ 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) {
++    } else if (strm->avail_in == 0 && old_flush == Z_BLOCK &&
++               RANK(flush) <= RANK(old_flush) && flush != Z_FINISH) {
+         ERR_RETURN(strm, Z_BUF_ERROR);
+     }
+ 
+-- 
+1.7.11.4
+
diff --git a/zlib.spec b/zlib.spec
index 27d342c..a8a6bb2 100644
--- a/zlib.spec
+++ b/zlib.spec
@@ -1,11 +1,12 @@
 Summary: The zlib compression and decompression library
 Name: zlib
 Version: 1.2.7
-Release: 6%{?dist}
+Release: 7%{?dist}
 Group: System Environment/Libraries
 Source: http://www.zlib.net/zlib-%{version}.tar.bz2
 Patch0: zlib-1.2.5-minizip-fixuncrypt.patch
 Patch1: zlib-1.2.7-optimized-s390.patch
+Patch2: zlib-1.2.7-z-block-flush.patch
 URL: http://www.zlib.net/
 # /contrib/dotzlib/ have Boost license
 License: zlib and Boost
@@ -60,6 +61,7 @@ developing applications which use minizip.
 %ifarch s390 s390x
 %patch1 -p1 -b .optimized-deflate
 %endif
+%patch2 -p1 -b .z-flush
 iconv -f windows-1252 -t utf-8 <ChangeLog >ChangeLog.tmp
 mv ChangeLog.tmp ChangeLog
 
@@ -125,6 +127,10 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
 %{_libdir}/pkgconfig/minizip.pc
 
 %changelog
+* Wed Aug 22 2012 Peter Schiffer <pschiffe at redhat.com> - 1.2.7-7
+- resolves: #844791
+  rank Z_BLOCK flush below Z_PARTIAL_FLUSH only when last flush was Z_BLOCK
+
 * Mon Aug 13 2012 Peter Schiffer <pschiffe at redhat.com> - 1.2.7-6
 - added patch from IBM which optimizes deflate on s390(x) architectures
 


More information about the scm-commits mailing list