aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libz/infcodes.c
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-01-10 09:47:00 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-01-10 09:47:00 +0000
commit628b9c34751f3d4523e0a5a92c53a6af1d13d103 (patch)
tree3caf4fc6f883e76264c0a8d3c81387ebbb685ebf /lib/libz/infcodes.c
parentbd957a8d6c05c2b26507f0c310c269d02f187632 (diff)
downloadsrc-628b9c34751f3d4523e0a5a92c53a6af1d13d103.tar.gz
src-628b9c34751f3d4523e0a5a92c53a6af1d13d103.zip
Import zlib 1.1.3 onto the vendor branch.
Obtained from: ftp.cdrom.com:/pub/infozip/zlib
Notes
Notes: svn path=/vendor/libz/dist/; revision=42468
Diffstat (limited to 'lib/libz/infcodes.c')
-rw-r--r--lib/libz/infcodes.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/libz/infcodes.c b/lib/libz/infcodes.c
index 181aa5389639..d4e5ee9a5543 100644
--- a/lib/libz/infcodes.c
+++ b/lib/libz/infcodes.c
@@ -11,8 +11,6 @@
#include "inffast.h"
/* simplify the use of the inflate_huft type with some defines */
-#define base more.Base
-#define next more.Next
#define exop word.what.Exop
#define bits word.what.Bits
@@ -145,7 +143,7 @@ int r;
if ((e & 64) == 0) /* next table */
{
c->sub.code.need = e;
- c->sub.code.tree = t->next;
+ c->sub.code.tree = t + t->base;
break;
}
if (e & 32) /* end of block */
@@ -183,7 +181,7 @@ int r;
if ((e & 64) == 0) /* next table */
{
c->sub.code.need = e;
- c->sub.code.tree = t->next;
+ c->sub.code.tree = t + t->base;
break;
}
c->mode = BADCODE; /* invalid code */
@@ -223,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