diff options
Diffstat (limited to 'inftrees.c')
-rw-r--r-- | inftrees.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -9,7 +9,7 @@ | |||
9 | #define MAXBITS 15 | 9 | #define MAXBITS 15 |
10 | 10 | ||
11 | const char inflate_copyright[] = | 11 | const char inflate_copyright[] = |
12 | " inflate 1.2.2.3 Copyright 1995-2005 Mark Adler "; | 12 | " inflate 1.2.2.4 Copyright 1995-2005 Mark Adler "; |
13 | /* | 13 | /* |
14 | If you use the zlib library in a product, an acknowledgment is welcome | 14 | If you use the zlib library in a product, an acknowledgment is welcome |
15 | in the documentation of your product. If for some reason you cannot | 15 | in the documentation of your product. If for some reason you cannot |
@@ -62,7 +62,7 @@ unsigned short FAR *work; | |||
62 | 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; | 62 | 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; |
63 | static const unsigned short lext[31] = { /* Length codes 257..285 extra */ | 63 | static const unsigned short lext[31] = { /* Length codes 257..285 extra */ |
64 | 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, | 64 | 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, |
65 | 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 66, 71}; | 65 | 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 206, 69}; |
66 | static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ | 66 | static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ |
67 | 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, | 67 | 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, |
68 | 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, | 68 | 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, |
@@ -134,7 +134,7 @@ unsigned short FAR *work; | |||
134 | left -= count[len]; | 134 | left -= count[len]; |
135 | if (left < 0) return -1; /* over-subscribed */ | 135 | if (left < 0) return -1; /* over-subscribed */ |
136 | } | 136 | } |
137 | if (left > 0 && (type == CODES || (codes - count[0] != 1))) | 137 | if (left > 0 && (type == CODES || max != 1)) |
138 | return -1; /* incomplete set */ | 138 | return -1; /* incomplete set */ |
139 | 139 | ||
140 | /* generate offsets into symbol table for each length for sorting */ | 140 | /* generate offsets into symbol table for each length for sorting */ |
@@ -232,6 +232,7 @@ unsigned short FAR *work; | |||
232 | /* replicate for those indices with low len bits equal to huff */ | 232 | /* replicate for those indices with low len bits equal to huff */ |
233 | incr = 1U << (len - drop); | 233 | incr = 1U << (len - drop); |
234 | fill = 1U << curr; | 234 | fill = 1U << curr; |
235 | min = fill; /* save offset to next table */ | ||
235 | do { | 236 | do { |
236 | fill -= incr; | 237 | fill -= incr; |
237 | next[(huff >> drop) + fill] = this; | 238 | next[(huff >> drop) + fill] = this; |
@@ -262,7 +263,7 @@ unsigned short FAR *work; | |||
262 | drop = root; | 263 | drop = root; |
263 | 264 | ||
264 | /* increment past last table */ | 265 | /* increment past last table */ |
265 | next += (unsigned)(1U << curr); | 266 | next += min; /* here min is 1 << curr */ |
266 | 267 | ||
267 | /* determine length of next table */ | 268 | /* determine length of next table */ |
268 | curr = len - drop; | 269 | curr = len - drop; |