mirror of
https://github.com/GerbilSoft/zlib-ng.git
synced 2025-06-18 11:35:35 -04:00
IBM Z DFLTCC: Fix updating strm.adler with inflate()
inflate() does not update strm.adler with DFLTCC. Add a missing assignment to dfltcc_inflate() to fix this. Note that deflate() is not affected. Also add a test to prevent regressions.
This commit is contained in:
parent
6057002d48
commit
d38dd9240f
@ -115,7 +115,7 @@ dfltcc_inflate_action Z_INTERNAL PREFIX(dfltcc_inflate)(PREFIX3(streamp) strm, i
|
||||
state->bits = param->sbb;
|
||||
state->whave = param->hl;
|
||||
state->wnext = (param->ho + param->hl) & ((1 << HB_BITS) - 1);
|
||||
state->check = state->flags ? ZSWAP32(param->cv) : param->cv;
|
||||
strm->adler = state->check = state->flags ? ZSWAP32(param->cv) : param->cv;
|
||||
if (cc == DFLTCC_CC_OP2_CORRUPT && param->oesc != 0) {
|
||||
/* Report an error if stream is corrupted */
|
||||
state->mode = BAD;
|
||||
|
@ -41,6 +41,8 @@ TEST(inflate, adler32) {
|
||||
err = PREFIX(inflate)(&strm, Z_NO_FLUSH);
|
||||
EXPECT_EQ(err, Z_STREAM_END);
|
||||
|
||||
EXPECT_EQ(strm.adler, 0x6b931030);
|
||||
|
||||
err = PREFIX(inflateEnd)(&strm);
|
||||
EXPECT_EQ(err, Z_OK);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user