]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Don't compute check value for raw inflate if asked to validate.
authorMark Adler <madler@alumni.caltech.edu>
Thu, 30 Mar 2017 21:48:43 +0000 (14:48 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 15 Jan 2019 09:50:50 +0000 (10:50 +0100)
inflate.c

index ee0e5308c549a865d54b1b2b02dcd977743ea873..d17bc274d738311dc46b0f991c033f143450ba66 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -1503,7 +1503,7 @@ int ZEXPORT PREFIX(inflateValidate)(PREFIX3(stream) *strm, int check) {
     if (inflateStateCheck(strm))
         return Z_STREAM_ERROR;
     state = (struct inflate_state *)strm->state;
-    if (check)
+    if (check && state->wrap)
         state->wrap |= 4;
     else
         state->wrap &= ~4;