diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-04-20 00:08:54 +0800 |
commit | 004b98220a30de0d1956a8149d8bc6ec356667da (patch) | |
tree | 1eaee2603984d7ab4524be68b57ce0a2b2b72118 /arch/s390/dfltcc_inflate.c | |
parent | 2ca0d0b38b60e8d6d49a8959bf674a79e7d16f41 (diff) | |
parent | a583e215afa2356e23b418efa871a1cc4348702a (diff) |
Merge tag '2.0.7' into tachibanatachibana-mr1tachibana
Change-Id: I7b03d60d67d184c21ff7437a35062077666951e9
Diffstat (limited to 'arch/s390/dfltcc_inflate.c')
-rw-r--r-- | arch/s390/dfltcc_inflate.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/s390/dfltcc_inflate.c b/arch/s390/dfltcc_inflate.c index 2535064..801e547 100644 --- a/arch/s390/dfltcc_inflate.c +++ b/arch/s390/dfltcc_inflate.c @@ -81,13 +81,14 @@ dfltcc_inflate_action Z_INTERNAL dfltcc_inflate(PREFIX3(streamp) strm, int flush } /* Translate stream to parameter block */ - param->cvt = state->flags ? CVT_CRC32 : CVT_ADLER32; + param->cvt = ((state->wrap & 4) && state->flags) ? CVT_CRC32 : CVT_ADLER32; param->sbb = state->bits; param->hl = state->whave; /* Software and hardware history formats match */ param->ho = (state->wnext - state->whave) & ((1 << HB_BITS) - 1); if (param->hl) param->nt = 0; /* Honor history for the first block */ - param->cv = state->flags ? ZSWAP32(state->check) : state->check; + if (state->wrap & 4) + param->cv = state->flags ? ZSWAP32(state->check) : state->check; /* Inflate */ do { @@ -100,7 +101,8 @@ dfltcc_inflate_action Z_INTERNAL dfltcc_inflate(PREFIX3(streamp) strm, int flush 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; + if (state->wrap & 4) + 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; |