--- old/src/java.base/share/native/libzip/zlib/deflate.c 2017-12-01 18:40:52.487748849 -0800 +++ new/src/java.base/share/native/libzip/zlib/deflate.c 2017-12-01 18:40:52.088712832 -0800 @@ -505,8 +505,6 @@ s->pending = 0; s->pending_out = s->pending_buf; - s->high_water = 0; /* reset to its inital value 0 */ - if (s->wrap < 0) { s->wrap = -s->wrap; /* was made negative by deflate(..., Z_FINISH); */ } @@ -520,7 +518,7 @@ s->wrap == 2 ? crc32(0L, Z_NULL, 0) : #endif adler32(0L, Z_NULL, 0); - s->last_flush = Z_NO_FLUSH; + s->last_flush = -2; _tr_init(s); @@ -613,7 +611,7 @@ func = configuration_table[s->level].func; if ((strategy != s->strategy || func != configuration_table[level].func) && - s->high_water) { + s->last_flush != -2) { /* Flush the last buffer: */ int err = deflate(strm, Z_BLOCK); if (err == Z_STREAM_ERROR)