Avoid casting an out-of-range value to long.

This commit is contained in:
Mark Adler 2016-10-11 18:38:20 -07:00
parent e08118c401
commit 2edb94a302
1 changed files with 1 additions and 1 deletions

View File

@ -1526,7 +1526,7 @@ z_streamp strm;
struct inflate_state FAR *state;
if (strm == Z_NULL || strm->state == Z_NULL)
return (long)(((unsigned long)0 - 1) << 16);
return -(1L << 16);
state = (struct inflate_state FAR *)strm->state;
return (long)(((unsigned long)((long)state->back)) << 16) +
(state->mode == COPY ? state->length :