|
Lines 702-707
Link Here
|
| 702 |
if (state->flags & 0x0200) CRC2(state->check, hold); |
702 |
if (state->flags & 0x0200) CRC2(state->check, hold); |
| 703 |
INITBITS(); |
703 |
INITBITS(); |
| 704 |
state->mode = TIME; |
704 |
state->mode = TIME; |
|
|
705 |
/* FALL THROUGH */ |
| 705 |
case TIME: |
706 |
case TIME: |
| 706 |
NEEDBITS(32); |
707 |
NEEDBITS(32); |
| 707 |
if (state->head != Z_NULL) |
708 |
if (state->head != Z_NULL) |
|
Lines 709-714
Link Here
|
| 709 |
if (state->flags & 0x0200) CRC4(state->check, hold); |
710 |
if (state->flags & 0x0200) CRC4(state->check, hold); |
| 710 |
INITBITS(); |
711 |
INITBITS(); |
| 711 |
state->mode = OS; |
712 |
state->mode = OS; |
|
|
713 |
/* FALL THROUGH */ |
| 712 |
case OS: |
714 |
case OS: |
| 713 |
NEEDBITS(16); |
715 |
NEEDBITS(16); |
| 714 |
if (state->head != Z_NULL) { |
716 |
if (state->head != Z_NULL) { |
|
Lines 718-723
Link Here
|
| 718 |
if (state->flags & 0x0200) CRC2(state->check, hold); |
720 |
if (state->flags & 0x0200) CRC2(state->check, hold); |
| 719 |
INITBITS(); |
721 |
INITBITS(); |
| 720 |
state->mode = EXLEN; |
722 |
state->mode = EXLEN; |
|
|
723 |
/* FALL THROUGH */ |
| 721 |
case EXLEN: |
724 |
case EXLEN: |
| 722 |
if (state->flags & 0x0400) { |
725 |
if (state->flags & 0x0400) { |
| 723 |
NEEDBITS(16); |
726 |
NEEDBITS(16); |
|
Lines 730-735
Link Here
|
| 730 |
else if (state->head != Z_NULL) |
733 |
else if (state->head != Z_NULL) |
| 731 |
state->head->extra = Z_NULL; |
734 |
state->head->extra = Z_NULL; |
| 732 |
state->mode = EXTRA; |
735 |
state->mode = EXTRA; |
|
|
736 |
/* FALL THROUGH */ |
| 733 |
case EXTRA: |
737 |
case EXTRA: |
| 734 |
if (state->flags & 0x0400) { |
738 |
if (state->flags & 0x0400) { |
| 735 |
copy = state->length; |
739 |
copy = state->length; |
|
Lines 752-757
Link Here
|
| 752 |
} |
756 |
} |
| 753 |
state->length = 0; |
757 |
state->length = 0; |
| 754 |
state->mode = NAME; |
758 |
state->mode = NAME; |
|
|
759 |
/* FALL THROUGH */ |
| 755 |
case NAME: |
760 |
case NAME: |
| 756 |
if (state->flags & 0x0800) { |
761 |
if (state->flags & 0x0800) { |
| 757 |
if (have == 0) goto inf_leave; |
762 |
if (have == 0) goto inf_leave; |
|
Lines 773-778
Link Here
|
| 773 |
state->head->name = Z_NULL; |
778 |
state->head->name = Z_NULL; |
| 774 |
state->length = 0; |
779 |
state->length = 0; |
| 775 |
state->mode = COMMENT; |
780 |
state->mode = COMMENT; |
|
|
781 |
/* FALL THROUGH */ |
| 776 |
case COMMENT: |
782 |
case COMMENT: |
| 777 |
if (state->flags & 0x1000) { |
783 |
if (state->flags & 0x1000) { |
| 778 |
if (have == 0) goto inf_leave; |
784 |
if (have == 0) goto inf_leave; |
|
Lines 793-798
Link Here
|
| 793 |
else if (state->head != Z_NULL) |
799 |
else if (state->head != Z_NULL) |
| 794 |
state->head->comment = Z_NULL; |
800 |
state->head->comment = Z_NULL; |
| 795 |
state->mode = HCRC; |
801 |
state->mode = HCRC; |
|
|
802 |
/* FALL THROUGH */ |
| 796 |
case HCRC: |
803 |
case HCRC: |
| 797 |
if (state->flags & 0x0200) { |
804 |
if (state->flags & 0x0200) { |
| 798 |
NEEDBITS(16); |
805 |
NEEDBITS(16); |
|
Lines 816-821
Link Here
|
| 816 |
strm->adler = state->check = ZSWAP32(hold); |
823 |
strm->adler = state->check = ZSWAP32(hold); |
| 817 |
INITBITS(); |
824 |
INITBITS(); |
| 818 |
state->mode = DICT; |
825 |
state->mode = DICT; |
|
|
826 |
/* FALL THROUGH */ |
| 819 |
case DICT: |
827 |
case DICT: |
| 820 |
if (state->havedict == 0) { |
828 |
if (state->havedict == 0) { |
| 821 |
RESTORE(); |
829 |
RESTORE(); |
|
Lines 823-830
Link Here
|
| 823 |
} |
831 |
} |
| 824 |
strm->adler = state->check = adler32(0L, Z_NULL, 0); |
832 |
strm->adler = state->check = adler32(0L, Z_NULL, 0); |
| 825 |
state->mode = TYPE; |
833 |
state->mode = TYPE; |
|
|
834 |
/* FALL THROUGH */ |
| 826 |
case TYPE: |
835 |
case TYPE: |
| 827 |
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; |
836 |
if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; |
|
|
837 |
/* FALL THROUGH */ |
| 828 |
case TYPEDO: |
838 |
case TYPEDO: |
| 829 |
if (state->last) { |
839 |
if (state->last) { |
| 830 |
BYTEBITS(); |
840 |
BYTEBITS(); |
|
Lines 877-882
Link Here
|
| 877 |
if (flush == Z_TREES) goto inf_leave; |
887 |
if (flush == Z_TREES) goto inf_leave; |
| 878 |
case COPY_: |
888 |
case COPY_: |
| 879 |
state->mode = COPY; |
889 |
state->mode = COPY; |
|
|
890 |
/* FALL THROUGH */ |
| 880 |
case COPY: |
891 |
case COPY: |
| 881 |
copy = state->length; |
892 |
copy = state->length; |
| 882 |
if (copy) { |
893 |
if (copy) { |
|
Lines 912-917
Link Here
|
| 912 |
Tracev((stderr, "inflate: table sizes ok\n")); |
923 |
Tracev((stderr, "inflate: table sizes ok\n")); |
| 913 |
state->have = 0; |
924 |
state->have = 0; |
| 914 |
state->mode = LENLENS; |
925 |
state->mode = LENLENS; |
|
|
926 |
/* FALL THROUGH */ |
| 915 |
case LENLENS: |
927 |
case LENLENS: |
| 916 |
while (state->have < state->ncode) { |
928 |
while (state->have < state->ncode) { |
| 917 |
NEEDBITS(3); |
929 |
NEEDBITS(3); |
|
Lines 933-938
Link Here
|
| 933 |
Tracev((stderr, "inflate: code lengths ok\n")); |
945 |
Tracev((stderr, "inflate: code lengths ok\n")); |
| 934 |
state->have = 0; |
946 |
state->have = 0; |
| 935 |
state->mode = CODELENS; |
947 |
state->mode = CODELENS; |
|
|
948 |
/* FALL THROUGH */ |
| 936 |
case CODELENS: |
949 |
case CODELENS: |
| 937 |
while (state->have < state->nlen + state->ndist) { |
950 |
while (state->have < state->nlen + state->ndist) { |
| 938 |
for (;;) { |
951 |
for (;;) { |
|
Lines 1016-1023
Link Here
|
| 1016 |
Tracev((stderr, "inflate: codes ok\n")); |
1029 |
Tracev((stderr, "inflate: codes ok\n")); |
| 1017 |
state->mode = LEN_; |
1030 |
state->mode = LEN_; |
| 1018 |
if (flush == Z_TREES) goto inf_leave; |
1031 |
if (flush == Z_TREES) goto inf_leave; |
|
|
1032 |
/* FALL THROUGH */ |
| 1019 |
case LEN_: |
1033 |
case LEN_: |
| 1020 |
state->mode = LEN; |
1034 |
state->mode = LEN; |
|
|
1035 |
/* FALL THROUGH */ |
| 1021 |
case LEN: |
1036 |
case LEN: |
| 1022 |
if (have >= 6 && left >= 258) { |
1037 |
if (have >= 6 && left >= 258) { |
| 1023 |
RESTORE(); |
1038 |
RESTORE(); |
|
Lines 1067-1072
Link Here
|
| 1067 |
} |
1082 |
} |
| 1068 |
state->extra = (unsigned)(here.op) & 15; |
1083 |
state->extra = (unsigned)(here.op) & 15; |
| 1069 |
state->mode = LENEXT; |
1084 |
state->mode = LENEXT; |
|
|
1085 |
/* FALL THROUGH */ |
| 1070 |
case LENEXT: |
1086 |
case LENEXT: |
| 1071 |
if (state->extra) { |
1087 |
if (state->extra) { |
| 1072 |
NEEDBITS(state->extra); |
1088 |
NEEDBITS(state->extra); |
|
Lines 1077-1082
Link Here
|
| 1077 |
Tracevv((stderr, "inflate: length %u\n", state->length)); |
1093 |
Tracevv((stderr, "inflate: length %u\n", state->length)); |
| 1078 |
state->was = state->length; |
1094 |
state->was = state->length; |
| 1079 |
state->mode = DIST; |
1095 |
state->mode = DIST; |
|
|
1096 |
/* FALL THROUGH */ |
| 1080 |
case DIST: |
1097 |
case DIST: |
| 1081 |
for (;;) { |
1098 |
for (;;) { |
| 1082 |
here = state->distcode[BITS(state->distbits)]; |
1099 |
here = state->distcode[BITS(state->distbits)]; |
|
Lines 1104-1109
Link Here
|
| 1104 |
state->offset = (unsigned)here.val; |
1121 |
state->offset = (unsigned)here.val; |
| 1105 |
state->extra = (unsigned)(here.op) & 15; |
1122 |
state->extra = (unsigned)(here.op) & 15; |
| 1106 |
state->mode = DISTEXT; |
1123 |
state->mode = DISTEXT; |
|
|
1124 |
/* FALL THROUGH */ |
| 1107 |
case DISTEXT: |
1125 |
case DISTEXT: |
| 1108 |
if (state->extra) { |
1126 |
if (state->extra) { |
| 1109 |
NEEDBITS(state->extra); |
1127 |
NEEDBITS(state->extra); |
|
Lines 1120-1125
Link Here
|
| 1120 |
#endif |
1138 |
#endif |
| 1121 |
Tracevv((stderr, "inflate: distance %u\n", state->offset)); |
1139 |
Tracevv((stderr, "inflate: distance %u\n", state->offset)); |
| 1122 |
state->mode = MATCH; |
1140 |
state->mode = MATCH; |
|
|
1141 |
/* FALL THROUGH */ |
| 1123 |
case MATCH: |
1142 |
case MATCH: |
| 1124 |
if (left == 0) goto inf_leave; |
1143 |
if (left == 0) goto inf_leave; |
| 1125 |
copy = out - left; |
1144 |
copy = out - left; |
|
Lines 1195-1200
Link Here
|
| 1195 |
} |
1214 |
} |
| 1196 |
#ifdef GUNZIP |
1215 |
#ifdef GUNZIP |
| 1197 |
state->mode = LENGTH; |
1216 |
state->mode = LENGTH; |
|
|
1217 |
/* FALL THROUGH */ |
| 1198 |
case LENGTH: |
1218 |
case LENGTH: |
| 1199 |
if (state->wrap && state->flags) { |
1219 |
if (state->wrap && state->flags) { |
| 1200 |
NEEDBITS(32); |
1220 |
NEEDBITS(32); |
|
Lines 1208-1213
Link Here
|
| 1208 |
} |
1228 |
} |
| 1209 |
#endif |
1229 |
#endif |
| 1210 |
state->mode = DONE; |
1230 |
state->mode = DONE; |
|
|
1231 |
/* FALL THROUGH */ |
| 1211 |
case DONE: |
1232 |
case DONE: |
| 1212 |
ret = Z_STREAM_END; |
1233 |
ret = Z_STREAM_END; |
| 1213 |
goto inf_leave; |
1234 |
goto inf_leave; |