]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fix shift of negative value in inflateMark().
authorMika Lindqvist <postmaster@raasu.org>
Fri, 29 Apr 2016 21:24:42 +0000 (00:24 +0300)
committerHans Kristian Rosbach <hk-git@circlestorm.org>
Tue, 31 Jan 2017 09:54:26 +0000 (10:54 +0100)
inflate.c
zlib.h

index a2ccfbf99b3381fed4ad7a3ec91e18efcd7aeff7..87ef0c48c828ae84942c81c0fae503b00b67d097 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -1460,7 +1460,7 @@ long ZEXPORT inflateMark(z_stream *strm) {
     struct inflate_state *state;
 
     if (strm == NULL || strm->state == NULL)
-        return -1L << 16;
+        return -65536;
     state = (struct inflate_state *)strm->state;
     return ((long)(state->back) << 16) + (state->mode == COPY ? state->length :
             (state->mode == MATCH ? state->was - state->length : 0));
diff --git a/zlib.h b/zlib.h
index d558f435231a5ac815c1f69f9bfbc552a58d2bb9..51f3c83fab7c1c5ae60a1adc325ae928a8020182 100644 (file)
--- a/zlib.h
+++ b/zlib.h
@@ -953,7 +953,7 @@ ZEXTERN long ZEXPORT inflateMark(z_stream *strm);
    location in the input stream can be determined from avail_in and data_type
    as noted in the description for the Z_BLOCK flush parameter for inflate.
 
-     inflateMark returns the value noted above or -1 << 16 if the provided
+     inflateMark returns the value noted above or -65536 if the provided
    source stream state was inconsistent.
 */