From: Mika Lindqvist Date: Fri, 29 Apr 2016 21:24:42 +0000 (+0300) Subject: Fix shift of negative value in inflateMark(). X-Git-Tag: 1.9.9-b1~751 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65b008bac08db4ea436057b836b4af0c830e6459;p=thirdparty%2Fzlib-ng.git Fix shift of negative value in inflateMark(). --- diff --git a/inflate.c b/inflate.c index a2ccfbf99..87ef0c48c 100644 --- 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 d558f4352..51f3c83fa 100644 --- 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. */