9
9
#define MAXBITS 15
10
10
11
11
const char inflate_copyright [] =
12
- " inflate 1.2.8 Copyright 1995-2013 Mark Adler " ;
12
+ " inflate 1.2.8.1 Copyright 1995-2013 Mark Adler " ;
13
13
/*
14
14
If you use the zlib library in a product, an acknowledgment is welcome
15
15
in the documentation of your product. If for some reason you cannot
@@ -48,15 +48,15 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigne
48
48
code FAR * next ; /* next available space in table */
49
49
const unsigned short FAR * base ; /* base value table to use */
50
50
const unsigned short FAR * extra ; /* extra bits table to use */
51
- int end ; /* use base and extra for symbol > end */
51
+ unsigned match ; /* use base and extra for symbol >= match */
52
52
unsigned short count [MAXBITS + 1 ]; /* number of codes of each length */
53
53
unsigned short offs [MAXBITS + 1 ]; /* offsets in table for each length */
54
54
static const unsigned short lbase [31 ] = { /* Length codes 257..285 base */
55
55
3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 13 , 15 , 17 , 19 , 23 , 27 , 31 ,
56
56
35 , 43 , 51 , 59 , 67 , 83 , 99 , 115 , 131 , 163 , 195 , 227 , 258 , 0 , 0 };
57
57
static const unsigned short lext [31 ] = { /* Length codes 257..285 extra */
58
58
16 , 16 , 16 , 16 , 16 , 16 , 16 , 16 , 17 , 17 , 17 , 17 , 18 , 18 , 18 , 18 ,
59
- 19 , 19 , 19 , 19 , 20 , 20 , 20 , 20 , 21 , 21 , 21 , 21 , 16 , 72 , 78 };
59
+ 19 , 19 , 19 , 19 , 20 , 20 , 20 , 20 , 21 , 21 , 21 , 21 , 16 , 203 , 198 };
60
60
static const unsigned short dbase [32 ] = { /* Distance codes 0..29 base */
61
61
1 , 2 , 3 , 4 , 5 , 7 , 9 , 13 , 17 , 25 , 33 , 49 , 65 , 97 , 129 , 193 ,
62
62
257 , 385 , 513 , 769 , 1025 , 1537 , 2049 , 3073 , 4097 , 6145 ,
@@ -175,19 +175,17 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigne
175
175
switch (type ) {
176
176
case CODES :
177
177
base = extra = work ; /* dummy value--not used */
178
- end = 19 ;
178
+ match = 20 ;
179
179
break ;
180
180
case LENS :
181
181
base = lbase ;
182
- base -= 257 ;
183
182
extra = lext ;
184
- extra -= 257 ;
185
- end = 256 ;
183
+ match = 257 ;
186
184
break ;
187
185
default : /* DISTS */
188
186
base = dbase ;
189
187
extra = dext ;
190
- end = -1 ;
188
+ match = 0 ;
191
189
}
192
190
193
191
/* initialize state for loop */
@@ -210,13 +208,13 @@ int ZLIB_INTERNAL inflate_table(codetype type, unsigned short FAR *lens, unsigne
210
208
for (;;) {
211
209
/* create table entry */
212
210
here .bits = (unsigned char )(len - drop );
213
- if (( int )( work [sym ]) < end ) {
211
+ if (work [sym ] + 1 < match ) {
214
212
here .op = (unsigned char )0 ;
215
213
here .val = work [sym ];
216
214
}
217
- else if (( int )( work [sym ]) > end ) {
218
- here .op = (unsigned char )(extra [work [sym ]]);
219
- here .val = base [work [sym ]];
215
+ else if (work [sym ] >= match ) {
216
+ here .op = (unsigned char )(extra [work [sym ] - match ]);
217
+ here .val = base [work [sym ] - match ];
220
218
}
221
219
else {
222
220
here .op = (unsigned char )(32 + 64 ); /* end of block */
0 commit comments