diff options
Diffstat (limited to 'inftrees.c')
-rw-r--r-- | inftrees.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -41,7 +41,7 @@ local uInt cplens[] = { /* Copy lengths for literal codes 257..285 */ | |||
41 | /* actually lengths - 2; also see note #13 above about 258 */ | 41 | /* actually lengths - 2; also see note #13 above about 258 */ |
42 | local uInt cplext[] = { /* Extra bits for literal codes 257..285 */ | 42 | local uInt cplext[] = { /* Extra bits for literal codes 257..285 */ |
43 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, | 43 | 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, |
44 | 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 128, 128}; /* 128==invalid */ | 44 | 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 192, 192}; /* 192==invalid */ |
45 | local uInt cpdist[] = { /* Copy offsets for distance codes 0..29 */ | 45 | local uInt cpdist[] = { /* Copy offsets for distance codes 0..29 */ |
46 | 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, | 46 | 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, |
47 | 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, | 47 | 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, |
@@ -246,7 +246,7 @@ z_stream *zs; /* for zalloc function */ | |||
246 | { | 246 | { |
247 | x[h] = i; /* save pattern for backing up */ | 247 | x[h] = i; /* save pattern for backing up */ |
248 | r.bits = (Byte)l; /* bits to dump before this table */ | 248 | r.bits = (Byte)l; /* bits to dump before this table */ |
249 | r.exop = -(Char)j; /* bits in this table */ | 249 | r.exop = j; /* bits in this table */ |
250 | r.next = q; /* pointer to this table */ | 250 | r.next = q; /* pointer to this table */ |
251 | j = i >> (w - l); /* (get around Turbo C bug) */ | 251 | j = i >> (w - l); /* (get around Turbo C bug) */ |
252 | u[h-1][j] = r; /* connect to last table */ | 252 | u[h-1][j] = r; /* connect to last table */ |
@@ -256,15 +256,15 @@ z_stream *zs; /* for zalloc function */ | |||
256 | /* set up table entry in r */ | 256 | /* set up table entry in r */ |
257 | r.bits = (Byte)(k - w); | 257 | r.bits = (Byte)(k - w); |
258 | if (p >= v + n) | 258 | if (p >= v + n) |
259 | r.exop = (Char)(-128); /* out of values--invalid code */ | 259 | r.exop = 128 + 64; /* out of values--invalid code */ |
260 | else if (*p < s) | 260 | else if (*p < s) |
261 | { | 261 | { |
262 | r.exop = (Char)(*p < 256 ? 16 : -64); /* 256 is end-of-block code */ | 262 | r.exop = (*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */ |
263 | r.base = *p++; /* simple code is just the value */ | 263 | r.base = *p++; /* simple code is just the value */ |
264 | } | 264 | } |
265 | else | 265 | else |
266 | { | 266 | { |
267 | r.exop = (Char)e[*p - s]; /* non-simple--look up in lists */ | 267 | r.exop = e[*p - s] + 16 + 64; /* non-simple--look up in lists */ |
268 | r.base = d[*p++ - s]; | 268 | r.base = d[*p++ - s]; |
269 | } | 269 | } |
270 | 270 | ||
@@ -457,10 +457,6 @@ z_stream *z; /* for zfree function */ | |||
457 | { | 457 | { |
458 | register inflate_huft *p, *q; | 458 | register inflate_huft *p, *q; |
459 | 459 | ||
460 | /* Don't free fixed trees */ | ||
461 | if (t >= fixed_mem && t <= fixed_mem + FIXEDH) | ||
462 | return Z_OK; | ||
463 | |||
464 | /* Go through linked list, freeing from the malloced (t[-1]) address. */ | 460 | /* Go through linked list, freeing from the malloced (t[-1]) address. */ |
465 | p = t; | 461 | p = t; |
466 | while (p != Z_NULL) | 462 | while (p != Z_NULL) |