Lines 983-988
Link Here
|
983 |
unsigned l; /* last length */ |
983 |
unsigned l; /* last length */ |
984 |
unsigned m; /* mask for bit lengths table */ |
984 |
unsigned m; /* mask for bit lengths table */ |
985 |
unsigned n; /* number of lengths to get */ |
985 |
unsigned n; /* number of lengths to get */ |
|
|
986 |
struct huft *tlp; |
986 |
struct huft *tl; /* literal/length code table */ |
987 |
struct huft *tl; /* literal/length code table */ |
987 |
struct huft *td; /* distance code table */ |
988 |
struct huft *td; /* distance code table */ |
988 |
unsigned bl; /* lookup bits for tl */ |
989 |
unsigned bl; /* lookup bits for tl */ |
Lines 996-1001
Link Here
|
996 |
int retval = 0; /* error code returned: initialized to "no error" */ |
997 |
int retval = 0; /* error code returned: initialized to "no error" */ |
997 |
|
998 |
|
998 |
|
999 |
|
|
|
1000 |
td = tlp = tl = (struct huft *)NULL; |
1001 |
|
999 |
/* make local bit buffer */ |
1002 |
/* make local bit buffer */ |
1000 |
Trace((stderr, "\ndynamic block")); |
1003 |
Trace((stderr, "\ndynamic block")); |
1001 |
b = G.bb; |
1004 |
b = G.bb; |
Lines 1047-1055
Link Here
|
1047 |
while (i < n) |
1050 |
while (i < n) |
1048 |
{ |
1051 |
{ |
1049 |
NEEDBITS(bl) |
1052 |
NEEDBITS(bl) |
1050 |
j = (td = tl + ((unsigned)b & m))->b; |
1053 |
j = (tlp = tl + ((unsigned)b & m))->b; |
1051 |
DUMPBITS(j) |
1054 |
DUMPBITS(j) |
1052 |
j = td->v.n; |
1055 |
j = tlp->v.n; |
1053 |
if (j < 16) /* length of code in bits (0..15) */ |
1056 |
if (j < 16) /* length of code in bits (0..15) */ |
1054 |
ll[i++] = l = j; /* save last length in l */ |
1057 |
ll[i++] = l = j; /* save last length in l */ |
1055 |
else if (j == 16) /* repeat last length 3 to 6 times */ |
1058 |
else if (j == 16) /* repeat last length 3 to 6 times */ |
Lines 1141-1146
Link Here
|
1141 |
huft_free(td); |
1144 |
huft_free(td); |
1142 |
} |
1145 |
} |
1143 |
huft_free(tl); |
1146 |
huft_free(tl); |
|
|
1147 |
|
1144 |
return retval; |
1148 |
return retval; |
1145 |
} |
1149 |
} |
1146 |
|
1150 |
|
Lines 1149-1156
Link Here
|
1149 |
|
1153 |
|
1150 |
cleanup_and_exit: |
1154 |
cleanup_and_exit: |
1151 |
/* free the decoding tables, return */ |
1155 |
/* free the decoding tables, return */ |
1152 |
huft_free(tl); |
1156 |
if (tl) huft_free(tl); |
1153 |
huft_free(td); |
1157 |
if (td) huft_free(td); |
1154 |
return retval; |
1158 |
return retval; |
1155 |
} |
1159 |
} |
1156 |
|
1160 |
|