summaryrefslogtreecommitdiff
path: root/lib/libz/inftrees.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-07-20 15:56:47 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-07-20 15:56:47 +0000
commit2cf630da4ce8cccae74ab052eb0055de8afc9502 (patch)
tree32220b8c594ae0352770c85d0463f63af944cf11 /lib/libz/inftrees.c
parent9ba66e2144908c121085b905f0ebf384b79343ba (diff)
Update to zlib 1.2.3; OK deraadt@
Diffstat (limited to 'lib/libz/inftrees.c')
-rw-r--r--lib/libz/inftrees.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libz/inftrees.c b/lib/libz/inftrees.c
index 5149610e545..2c516bb2952 100644
--- a/lib/libz/inftrees.c
+++ b/lib/libz/inftrees.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: inftrees.c,v 1.7 2005/07/06 14:53:44 millert Exp $ */
+/* $OpenBSD: inftrees.c,v 1.8 2005/07/20 15:56:41 millert Exp $ */
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2004 Mark Adler
+ * Copyright (C) 1995-2005 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -10,7 +10,7 @@
#define MAXBITS 15
const char inflate_copyright[] =
- " inflate 1.2.2 Copyright 1995-2004 Mark Adler ";
+ " inflate 1.2.3 Copyright 1995-2005 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -63,7 +63,7 @@ unsigned short FAR *work;
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
static const unsigned short lext[31] = { /* Length codes 257..285 extra */
16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
- 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 198};
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196};
static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
@@ -233,6 +233,7 @@ unsigned short FAR *work;
/* replicate for those indices with low len bits equal to huff */
incr = 1U << (len - drop);
fill = 1U << curr;
+ min = fill; /* save offset to next table */
do {
fill -= incr;
next[(huff >> drop) + fill] = this;
@@ -263,7 +264,7 @@ unsigned short FAR *work;
drop = root;
/* increment past last table */
- next += 1U << curr;
+ next += min; /* here min is 1 << curr */
/* determine length of next table */
curr = len - drop;