summaryrefslogtreecommitdiff
path: root/zlib/infcodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'zlib/infcodes.c')
-rw-r--r--zlib/infcodes.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/zlib/infcodes.c b/zlib/infcodes.c
index 1d3baa92..d4e5ee9a 100644
--- a/zlib/infcodes.c
+++ b/zlib/infcodes.c
@@ -221,6 +221,13 @@ int r;
c->mode = START;
break;
case WASH: /* o: got eob, possibly more output */
+ if (k > 7) /* return unused byte, if any */
+ {
+ Assert(k < 16, "inflate_codes grabbed too many bytes")
+ k -= 8;
+ n++;
+ p--; /* can always return one */
+ }
FLUSH
if (s->read != s->write)
LEAVE