Branch Coverage

miniz.c
Criterion Covered Total %
branch 386 3638 10.6


line true false branch
43 0 73890 if (!ptr)
45 250938 73890 while (buf_len)
47 132656820 250938 for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
58 293880 250938 for (; i < block_len; ++i)
134 0 0 while (buf_len >= 4)
144 0 0 while (buf_len)
193 0 73890 if (!pStream)
195 73890 0 if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
73890 0 if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
73890 0 if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
0 73890 if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
0 0 if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
204 73890 0 if (!pStream->zalloc)
206 73890 0 if (!pStream->zfree)
210 0 73890 if (!pComp)
215 0 73890 if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY)
226 0 0 if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree))
0 0 if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree))
0 0 if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree))
0 0 if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree))
239 73890 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
73890 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
73890 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
73890 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
0 73890 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
241 0 73890 if (!pStream->avail_out)
244 0 73890 if (flush == MZ_PARTIAL_FLUSH)
247 0 73890 if (((tdefl_compressor *)pStream->state)->m_prev_return_status == TDEFL_STATUS_DONE)
248 0 0 return (flush == MZ_FINISH) ? MZ_STREAM_END : MZ_BUF_ERROR;
268 0 73890 if (defl_status < 0)
273 73890 0 else if (defl_status == TDEFL_STATUS_DONE)
278 0 0 else if (!pStream->avail_out)
280 0 0 else if ((!pStream->avail_in) && (flush != MZ_FINISH))
0 0 else if ((!pStream->avail_in) && (flush != MZ_FINISH))
282 0 0 if ((flush) || (pStream->total_in != orig_total_in) || (pStream->total_out != orig_total_out))
0 0 if ((flush) || (pStream->total_in != orig_total_in) || (pStream->total_out != orig_total_out))
0 0 if ((flush) || (pStream->total_in != orig_total_in) || (pStream->total_out != orig_total_out))
293 0 73890 if (!pStream)
295 73890 0 if (pStream->state)
317 0 73890 if ((source_len | *pDest_len) > 0xFFFFFFFFU)
326 0 73890 if (status != MZ_OK)
330 0 73890 if (status != MZ_STREAM_END)
333 0 0 return (status == MZ_OK) ? MZ_BUF_ERROR : status;
362 0 0 if (!pStream)
364 0 0 if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS))
0 0 if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS))
373 0 0 if (!pStream->zalloc)
375 0 0 if (!pStream->zfree)
379 0 0 if (!pDecomp)
403 0 0 if (!pStream)
433 0 0 if ((!pStream) || (!pStream->state))
0 0 if ((!pStream) || (!pStream->state))
435 0 0 if (flush == MZ_PARTIAL_FLUSH)
437 0 0 if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH))
0 0 if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH))
0 0 if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH))
441 0 0 if (pState->m_window_bits > 0)
447 0 0 if (pState->m_last_status < 0)
450 0 0 if (pState->m_has_flushed && (flush != MZ_FINISH))
0 0 if (pState->m_has_flushed && (flush != MZ_FINISH))
454 0 0 if ((flush == MZ_FINISH) && (first_call))
0 0 if ((flush == MZ_FINISH) && (first_call))
470 0 0 if (status < 0)
472 0 0 else if (status != TINFL_STATUS_DONE)
480 0 0 if (flush != MZ_FINISH)
483 0 0 if (pState->m_dict_avail)
492 0 0 return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
0 0 return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
518 0 0 if (status < 0)
520 0 0 else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in))
0 0 else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in))
522 0 0 else if (flush == MZ_FINISH)
525 0 0 if (status == TINFL_STATUS_DONE)
526 0 0 return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
528 0 0 else if (!pStream->avail_out)
531 0 0 else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail))
0 0 else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail))
0 0 else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail))
0 0 else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail))
535 0 0 return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
0 0 return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
540 0 0 if (!pStream)
542 0 0 if (pStream->state)
557 0 0 if ((source_len | *pDest_len) > 0xFFFFFFFFU)
566 0 0 if (status != MZ_OK)
570 0 0 if (status != MZ_STREAM_END)
573 0 0 return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERROR : status;
0 0 return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERROR : status;
591 0 0 for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i)
592 0 0 if (s_error_descs[i].m_err == err)
737 609449 86616 for (i = 0; i < num_syms; i++)
743 86616 81144 while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256]))
81144 5472 while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256]))
745 92088 86616 for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8)
749 23574528 92088 for (i = 0; i < 256; i++)
754 657281 92088 for (i = 0; i < num_syms; i++)
769 0 86616 if (n == 0)
771 19620 66996 else if (n == 1)
779 455837 66996 for (next = 1; next < n - 1; next++)
781 412528 43309 if (leaf >= n || A[root].m_key < A[leaf].m_key)
179772 232756 if (leaf >= n || A[root].m_key < A[leaf].m_key)
788 392170 63667 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
360618 31552 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
169089 191529 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
797 455837 66996 for (next = n - 3; next >= 0; next--)
803 332074 66996 while (avbl > 0)
805 720915 133992 while (root >= 0 && (int)A[root].m_key == dpth)
522833 198082 while (root >= 0 && (int)A[root].m_key == dpth)
810 589829 332074 while (avbl > used)
830 19620 66996 if (code_list_len <= 1)
832 1369908 66996 for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++)
834 773964 66996 for (i = max_code_size; i > 0; i--)
836 0 66996 while (total != (1UL << max_code_size))
839 0 0 for (i = max_code_size - 1; i > 0; i--)
840 0 0 if (pNum_codes[i])
855 90036 86616 if (static_table)
857 14405760 90036 for (i = 0; i < table_len; i++)
865 9787608 86616 for (i = 0; i < table_len; i++)
866 609449 9178159 if (pSym_count[i])
875 609449 86616 for (i = 0; i < num_used_syms; i++)
882 1068264 86616 for (i = 1, j = num_used_syms; i <= code_size_limit; i++)
883 609449 1068264 for (l = num_codes[i]; l > 0; l--)
888 2242152 176652 for (j = 0, i = 2; i <= code_size_limit; i++)
891 24193368 176652 for (i = 0; i < table_len; i++)
894 9178159 15015209 if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0)
897 117208650 15015209 for (l = code_size; l > 0; l--, code >>= 1)
980 86423 0 for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--)
981 28872 57551 if (d->m_huff_code_sizes[0][num_lit_codes - 1])
983 664447 4536 for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--)
984 24336 640111 if (d->m_huff_code_sizes[1][num_dist_codes - 1])
995 8425890 28872 for (i = 0; i < total_code_sizes_to_pack; i++)
998 7993479 432411 if (!code_size)
1000 33709 7959770 TDEFL_RLE_PREV_CODE_SIZE();
30787 2922 TDEFL_RLE_PREV_CODE_SIZE();
37000 30787 TDEFL_RLE_PREV_CODE_SIZE();
1001 3780 7989699 if (++rle_z_count == 138)
1003 3780 0 TDEFL_RLE_ZERO_CODE_SIZE();
0 3780 TDEFL_RLE_ZERO_CODE_SIZE();
0 0 TDEFL_RLE_ZERO_CODE_SIZE();
0 3780 TDEFL_RLE_ZERO_CODE_SIZE();
1008 326869 105542 TDEFL_RLE_ZERO_CODE_SIZE();
90528 236341 TDEFL_RLE_ZERO_CODE_SIZE();
128853 90528 TDEFL_RLE_ZERO_CODE_SIZE();
64477 171864 TDEFL_RLE_ZERO_CODE_SIZE();
1009 370691 61720 if (code_size != prev_code_size)
1011 9289 361402 TDEFL_RLE_PREV_CODE_SIZE();
9044 245 TDEFL_RLE_PREV_CODE_SIZE();
11125 9044 TDEFL_RLE_PREV_CODE_SIZE();
1015 1 61719 else if (++rle_repeat_count == 6)
1017 1 0 TDEFL_RLE_PREV_CODE_SIZE();
0 1 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
1022 3567 25305 if (rle_repeat_count)
1024 3567 0 TDEFL_RLE_PREV_CODE_SIZE();
3555 12 TDEFL_RLE_PREV_CODE_SIZE();
3732 3555 TDEFL_RLE_PREV_CODE_SIZE();
1028 0 25305 TDEFL_RLE_ZERO_CODE_SIZE();
0 0 TDEFL_RLE_ZERO_CODE_SIZE();
0 0 TDEFL_RLE_ZERO_CODE_SIZE();
0 0 TDEFL_RLE_ZERO_CODE_SIZE();
1033 0 0 TDEFL_PUT_BITS(2, 2);
0 28872 TDEFL_PUT_BITS(2, 2);
1035 28872 0 TDEFL_PUT_BITS(num_lit_codes - 257, 5);
28872 28872 TDEFL_PUT_BITS(num_lit_codes - 257, 5);
1036 0 0 TDEFL_PUT_BITS(num_dist_codes - 1, 5);
0 28872 TDEFL_PUT_BITS(num_dist_codes - 1, 5);
1038 60274 0 for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--)
1039 28872 31402 if (d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]])
1042 28872 0 TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
28872 28872 TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
1043 517166 28872 for (i = 0; (int)i < num_bit_lengths; i++)
1044 173217 0 TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
173217 517166 TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
1046 794702 28872 for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes;)
1050 254542 0 TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
254542 794702 TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
1051 243301 551401 if (code >= 16)
1052 178469 0 TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
178469 243301 TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
1061 6482592 45018 for (i = 0; i <= 143; ++i)
1063 5042016 45018 for (; i <= 255; ++i)
1065 1080432 45018 for (; i <= 279; ++i)
1067 360144 45018 for (; i <= 287; ++i)
1075 0 0 TDEFL_PUT_BITS(1, 2);
0 45018 TDEFL_PUT_BITS(1, 2);
1097 4474796 73890 for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < pLZ_code_buf_end; flags >>= 1)
1099 644081 3830715 if (flags == 1)
1102 4165790 309006 if (flags & 1)
1117 4147934 17856 sym = (match_dist < 512) ? s0 : s1;
1118 4147934 17856 num_extra_bits = (match_dist < 512) ? n0 : n1;
1130 271589 37417 if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end))
259157 12432 if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end))
1137 197725 61432 if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end))
185065 12660 if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end))
1147 0 4474796 if (pOutput_buf >= d->m_pOutput_buf_end)
1162 65956 73890 while (bits_in)
1165 0 0 TDEFL_PUT_BITS((mz_uint)bit_buffer & mz_bitmasks[n], n);
0 65956 TDEFL_PUT_BITS((mz_uint)bit_buffer & mz_bitmasks[n], n);
1170 56160 0 TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
56160 73890 TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
1225 45018 28872 if (static_block)
1237 0 73890 int n, use_raw_block = ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) && (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size;
0 0 int n, use_raw_block = ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) && (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size;
1238 73890 0 mz_uint8 *pOutput_buf_start = ((d->m_pPut_buf_func == NULL) && ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE)) ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs) : d->m_output_buf;
2736 71154 mz_uint8 *pOutput_buf_start = ((d->m_pPut_buf_func == NULL) && ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE)) ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs) : d->m_output_buf;
1250 73890 0 if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index))
73890 0 if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index))
1252 73890 0 TDEFL_PUT_BITS(0x78, 8);
73890 73890 TDEFL_PUT_BITS(0x78, 8);
1253 73890 0 TDEFL_PUT_BITS(0x01, 8);
73890 73890 TDEFL_PUT_BITS(0x01, 8);
1256 0 0 TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
0 73890 TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
1262 73890 0 if (!use_raw_block)
1263 73890 0 comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48));
45018 28872 comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48));
1266 73890 0 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
73890 0 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
37779 36111 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
37779 0 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
1272 0 0 TDEFL_PUT_BITS(0, 2);
0 37779 TDEFL_PUT_BITS(0, 2);
1273 37779 0 if (d->m_bits_in)
1275 37779 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
37779 37779 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1277 75558 37779 for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF)
1279 151116 0 TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
151116 75558 TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
1281 334720 37779 for (i = 0; i < d->m_total_lz_bytes; ++i)
1283 334720 0 TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
334720 334720 TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
1287 0 36111 else if (!comp_block_succeeded)
1294 73890 0 if (flush)
1296 73890 0 if (flush == TDEFL_FINISH)
1298 31317 42573 if (d->m_bits_in)
1300 31317 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
31317 31317 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1302 73890 0 if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER)
1305 295560 73890 for (i = 0; i < 4; i++)
1307 295560 0 TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
295560 295560 TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
1315 0 0 TDEFL_PUT_BITS(0, 3);
0 0 TDEFL_PUT_BITS(0, 3);
1316 0 0 if (d->m_bits_in)
1318 0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1320 0 0 for (i = 2; i; --i, z ^= 0xFFFF)
1322 0 0 TDEFL_PUT_BITS(z & 0xFFFF, 16);
0 0 TDEFL_PUT_BITS(z & 0xFFFF, 16);
1339 73890 0 if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0)
1341 0 73890 if (d->m_pPut_buf_func)
1344 0 0 if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user))
1347 71154 2736 else if (pOutput_buf_start == d->m_output_buf)
1349 0 71154 int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs));
1352 0 71154 if ((n -= bytes_to_copy) != 0)
1392 4825734 93284 if (max_match_len <= match_len)
1398 6281017 32880 if (--num_probes_left == 0)
1407 5622040 658977 TDEFL_PROBE;
5600800 21240 TDEFL_PROBE;
1200637 4400163 TDEFL_PROBE;
1408 1192500 8137 TDEFL_PROBE;
1192428 72 TDEFL_PROBE;
1192212 216 TDEFL_PROBE;
1409 1192116 96 TDEFL_PROBE;
1192116 0 TDEFL_PROBE;
1191972 144 TDEFL_PROBE;
1411 4400523 0 if (!dist)
1414 4885 4395638 if (TDEFL_READ_UNALIGNED_WORD2(q) != s01)
1421 133901160 53378 (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
133641564 111852 (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
129558900 4082664 (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
1422 4082664 312974 if (!probe_len)
1428 312974 0 else if ((probe_len = ((mz_uint)(p - s) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q)) > match_len)
1431 291306 21668 if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) == max_match_len)
1501 0 0 while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size)))
0 0 while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size)))
0 0 while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size)))
1505 0 0 mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(d->m_src_buf_left, TDEFL_COMP_FAST_LOOKAHEAD_SIZE - lookahead_size);
1509 0 0 while (num_bytes_to_process)
1513 0 0 if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
1521 0 0 if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE))
0 0 if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE))
1524 0 0 while (lookahead_size >= 4)
1533 0 0 if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <= dict_size) && ((TDEFL_READ_UNALIGNED_WORD32(d->m_dict + (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) & 0xFFFFFF) == first_trigram))
0 0 if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <= dict_size) && ((TDEFL_READ_UNALIGNED_WORD32(d->m_dict + (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) & 0xFFFFFF) == first_trigram))
1541 0 0 (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
0 0 (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
0 0 (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
1543 0 0 if (!probe_len)
1544 0 0 cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0;
1546 0 0 if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)))
0 0 if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)))
0 0 if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)))
1573 0 0 d->m_huff_count[1][(cur_match_dist < 512) ? s0 : s1]++;
1585 0 0 if (--num_flags_left == 0)
1598 0 0 if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8])
1608 0 0 if ((n = tdefl_flush_block(d, 0)) != 0)
1617 0 0 while (lookahead_size)
1624 0 0 if (--num_flags_left == 0)
1637 0 0 if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8])
1647 0 0 if ((n = tdefl_flush_block(d, 0)) != 0)
1673 0 0 if (--d->m_num_flags_left == 0)
58987 694241 if (--d->m_num_flags_left == 0)
1697 0 0 if (--d->m_num_flags_left == 0)
0 0 if (--d->m_num_flags_left == 0)
518940 3646850 if (--d->m_num_flags_left == 0)
1705 0 0 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
0 0 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
4147934 17856 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
1707 0 0 if (match_len >= TDEFL_MIN_MATCH_LEN)
0 0 if (match_len >= TDEFL_MIN_MATCH_LEN)
4165790 0 if (match_len >= TDEFL_MIN_MATCH_LEN)
1717 4426050 566858 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
566858 0 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
492968 73890 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
1721 4845128 73890 if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1))
1725 518744 4326384 mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size);
1729 1054125864 4845128 while (pSrc != pSrc_end)
1733 5322552 1048803312 if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
1744 7448496 47970 while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
7422576 25920 while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
1750 7396656 25920 if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
1752 7275168 147408 if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN)
1762 0 4919018 if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
0 0 if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
1768 0 4919018 cur_match_len = d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1);
1770 0 4919018 if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS))
1772 0 0 if ((d->m_dict_size) && (!(d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS)))
0 0 if ((d->m_dict_size) && (!(d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS)))
1776 0 0 while (cur_match_len < d->m_lookahead_size)
1778 0 0 if (d->m_dict[cur_pos + cur_match_len] != c)
1782 0 0 if (cur_match_len < TDEFL_MIN_MATCH_LEN)
1792 8906 4910112 if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5)))
8906 0 if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5)))
4845008 74010 if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5)))
0 4845008 if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5)))
0 0 if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5)))
1796 0 4919018 if (d->m_saved_match_len)
1798 0 0 if (cur_match_len > d->m_saved_match_len)
1801 0 0 if (cur_match_len >= 128)
1821 753228 4165790 else if (!cur_match_dist)
1822 753228 0 tdefl_record_literal(d, d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]);
1823 0 4165790 else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128))
0 0 else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128))
0 0 else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128))
1830 0 0 d->m_saved_lit = d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)];
1840 4919018 0 if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) ||
2281608 2637410 if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) ||
1841 2281608 0 ((d->m_total_lz_bytes > 31 * 1024) && (((((mz_uint)(d->m_pLZ_code_buf - d->m_lz_code_buf) * 115) >> 7) >= d->m_total_lz_bytes) || (d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))))
0 2281608 ((d->m_total_lz_bytes > 31 * 1024) && (((((mz_uint)(d->m_pLZ_code_buf - d->m_lz_code_buf) * 115) >> 7) >= d->m_total_lz_bytes) || (d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))))
1846 0 0 if ((n = tdefl_flush_block(d, 0)) != 0)
1858 73890 0 if (d->m_pIn_buf_size)
1863 73890 0 if (d->m_pOut_buf_size)
1874 73890 0 return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY;
73890 0 return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY;
1879 0 73890 if (!d)
1881 0 0 if (pIn_buf_size)
1883 0 0 if (pOut_buf_size)
1893 73890 0 d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0;
1897 0 73890 if (((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) ||
0 0 if (((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) ||
73890 0 if (((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) ||
73890 0 if (((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) ||
0 73890 if (((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) ||
1898 0 0 (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
73890 0 (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
73890 0 (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
73890 0 (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
73890 0 (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
73890 0 (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
0 73890 (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
1900 0 0 if (pIn_buf_size)
1902 0 0 if (pOut_buf_size)
1908 73890 0 if ((d->m_output_flush_remaining) || (d->m_finished))
0 73890 if ((d->m_output_flush_remaining) || (d->m_finished))
1912 0 73890 if (((d->m_flags & TDEFL_MAX_PROBES_MASK) == 1) &&
0 0 if (((d->m_flags & TDEFL_MAX_PROBES_MASK) == 1) &&
1913 0 0 ((d->m_flags & TDEFL_GREEDY_PARSING_FLAG) != 0) &&
1916 0 0 if (!tdefl_compress_fast(d))
1922 0 73890 if (!tdefl_compress_normal(d))
1926 73890 0 if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf))
73890 0 if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf))
1929 73890 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
73890 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
73890 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
73890 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
1931 0 73890 if (tdefl_flush_block(d, flush) < 0)
1934 0 73890 if (flush == TDEFL_FULL_FLUSH)
1959 73890 0 if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
1979 73890 0 if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
2000 0 0 if (((buf_len) && (!pBuf)) || (!pPut_buf_func))
0 0 if (((buf_len) && (!pBuf)) || (!pPut_buf_func))
0 0 if (((buf_len) && (!pBuf)) || (!pPut_buf_func))
2003 0 0 if (!pComp)
2006 0 0 succeeded = succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) == TDEFL_STATUS_DONE);
0 0 succeeded = succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) == TDEFL_STATUS_DONE);
2022 0 0 if (new_size > p->m_capacity)
2026 0 0 if (!p->m_expandable)
2031 0 0 } while (new_size > new_capacity);
2033 0 0 if (!pNew_buf)
2047 0 0 if (!pOut_len)
2052 0 0 if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
2062 0 0 if (!pOut_buf)
2066 0 0 if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
2076 0 73890 mz_uint comp_flags = s_tdefl_num_probes[(level >= 0) ? MZ_MIN(10, level) : MZ_DEFAULT_LEVEL] | ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0);
73890 0 mz_uint comp_flags = s_tdefl_num_probes[(level >= 0) ? MZ_MIN(10, level) : MZ_DEFAULT_LEVEL] | ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0);
2077 73890 0 if (window_bits > 0)
2080 0 73890 if (!level)
2082 0 73890 else if (strategy == MZ_FILTERED)
2084 0 73890 else if (strategy == MZ_HUFFMAN_ONLY)
2086 0 73890 else if (strategy == MZ_FIXED)
2088 0 73890 else if (strategy == MZ_RLE)
2111 0 0 if (!pComp)
2116 0 0 if (NULL == (out_buf.m_pBuf = (mz_uint8 *)MZ_MALLOC(out_buf.m_capacity)))
2122 0 0 for (z = 41; z; --z)
2126 0 0 for (y = 0; y < h; ++y)
2129 0 0 tdefl_compress_buffer(pComp, (mz_uint8 *)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH);
2131 0 0 if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE)
2160 0 0 for (i = 0; i < 4; ++i, c <<= 8)
2165 0 0 if (!tdefl_output_buffer_putter("\0\0\0\0\0\0\0\0\x49\x45\x4e\x44\xae\x42\x60\x82", 16, &out_buf))
2173 0 0 for (i = 0; i < 4; ++i, c <<= 8)
2395 0 0 size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start;
2398 0 0 if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start))
0 0 if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start))
2414 0 0 if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
2416 0 0 TINFL_GET_BYTE(1, r->m_zhdr0);
0 0 TINFL_GET_BYTE(1, r->m_zhdr0);
2417 0 0 TINFL_GET_BYTE(2, r->m_zhdr1);
0 0 TINFL_GET_BYTE(2, r->m_zhdr1);
2418 0 0 counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8));
0 0 counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8));
0 0 counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8));
2419 0 0 if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
2420 0 0 counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4)))));
0 0 counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4)))));
2421 0 0 if (counter)
2429 0 0 TINFL_GET_BITS(3, r->m_final, 3);
0 0 TINFL_GET_BITS(3, r->m_final, 3);
0 0 TINFL_GET_BITS(3, r->m_final, 3);
0 0 TINFL_GET_BITS(3, r->m_final, 3);
2431 0 0 if (r->m_type == 0)
2433 0 0 TINFL_SKIP_BITS(5, num_bits & 7);
0 0 TINFL_SKIP_BITS(5, num_bits & 7);
0 0 TINFL_SKIP_BITS(5, num_bits & 7);
0 0 TINFL_SKIP_BITS(5, num_bits & 7);
2434 0 0 for (counter = 0; counter < 4; ++counter)
2436 0 0 if (num_bits)
2437 0 0 TINFL_GET_BITS(6, r->m_raw_header[counter], 8);
0 0 TINFL_GET_BITS(6, r->m_raw_header[counter], 8);
0 0 TINFL_GET_BITS(6, r->m_raw_header[counter], 8);
0 0 TINFL_GET_BITS(6, r->m_raw_header[counter], 8);
2439 0 0 TINFL_GET_BYTE(7, r->m_raw_header[counter]);
0 0 TINFL_GET_BYTE(7, r->m_raw_header[counter]);
2441 0 0 if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8))))
2445 0 0 while ((counter) && (num_bits))
0 0 while ((counter) && (num_bits))
2447 0 0 TINFL_GET_BITS(51, dist, 8);
0 0 TINFL_GET_BITS(51, dist, 8);
0 0 TINFL_GET_BITS(51, dist, 8);
0 0 TINFL_GET_BITS(51, dist, 8);
2448 0 0 while (pOut_buf_cur >= pOut_buf_end)
2455 0 0 while (counter)
2458 0 0 while (pOut_buf_cur >= pOut_buf_end)
2462 0 0 while (pIn_buf_cur >= pIn_buf_end)
2464 0 0 TINFL_CR_RETURN(38, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS);
2473 0 0 else if (r->m_type == 3)
2479 0 0 if (r->m_type == 1)
2486 0 0 for (i = 0; i <= 143; ++i)
2488 0 0 for (; i <= 255; ++i)
2490 0 0 for (; i <= 279; ++i)
2492 0 0 for (; i <= 287; ++i)
2497 0 0 for (counter = 0; counter < 3; counter++)
2499 0 0 TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]);
0 0 TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]);
0 0 TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]);
0 0 TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]);
2503 0 0 for (counter = 0; counter < r->m_table_sizes[2]; counter++)
2506 0 0 TINFL_GET_BITS(14, s, 3);
0 0 TINFL_GET_BITS(14, s, 3);
0 0 TINFL_GET_BITS(14, s, 3);
0 0 TINFL_GET_BITS(14, s, 3);
2511 0 0 for (; (int)r->m_type >= 0; r->m_type--)
2520 0 0 for (i = 0; i < r->m_table_sizes[r->m_type]; ++i)
2524 0 0 for (i = 1; i <= 15; ++i)
2529 0 0 if ((65536 != total) && (used_syms > 1))
0 0 if ((65536 != total) && (used_syms > 1))
2533 0 0 for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index)
2536 0 0 if (!code_size)
2539 0 0 for (l = code_size; l > 0; l--, cur_code >>= 1)
2541 0 0 if (code_size <= TINFL_FAST_LOOKUP_BITS)
2544 0 0 while (rev_code < TINFL_FAST_LOOKUP_SIZE)
2551 0 0 if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)]))
2558 0 0 for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--)
2561 0 0 if (!pTable->m_tree[-tree_cur - 1])
2573 0 0 if (r->m_type == 2)
2575 0 0 for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]);)
2578 0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
0 0 TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
2579 0 0 if (dist < 16)
2584 0 0 if ((dist == 16) && (!counter))
0 0 if ((dist == 16) && (!counter))
2589 0 0 TINFL_GET_BITS(18, s, num_extra);
0 0 TINFL_GET_BITS(18, s, num_extra);
0 0 TINFL_GET_BITS(18, s, num_extra);
0 0 TINFL_GET_BITS(18, s, num_extra);
2591 0 0 TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s);
2594 0 0 if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter)
2607 0 0 if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2))
0 0 if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2))
2609 0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
0 0 TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
2610 0 0 if (counter >= 256)
2612 0 0 while (pOut_buf_cur >= pOut_buf_end)
2623 0 0 if (num_bits < 30)
2637 0 0 if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
2645 0 0 } while (sym2 < 0);
2650 0 0 if (counter & 256)
2661 0 0 if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
2669 0 0 } while (sym2 < 0);
2675 0 0 if (sym2 & 256)
2685 0 0 if ((counter &= 511) == 256)
2690 0 0 if (num_extra)
2693 0 0 TINFL_GET_BITS(25, extra_bits, num_extra);
0 0 TINFL_GET_BITS(25, extra_bits, num_extra);
0 0 TINFL_GET_BITS(25, extra_bits, num_extra);
0 0 TINFL_GET_BITS(25, extra_bits, num_extra);
2697 0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
0 0 TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
2700 0 0 if (num_extra)
2703 0 0 TINFL_GET_BITS(27, extra_bits, num_extra);
0 0 TINFL_GET_BITS(27, extra_bits, num_extra);
0 0 TINFL_GET_BITS(27, extra_bits, num_extra);
0 0 TINFL_GET_BITS(27, extra_bits, num_extra);
2708 0 0 if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
0 0 if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
2715 0 0 if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end)
2717 0 0 while (counter--)
2719 0 0 while (pOut_buf_cur >= pOut_buf_end)
2728 0 0 else if ((counter >= 9) && (counter <= dist))
0 0 else if ((counter >= 9) && (counter <= dist))
2740 0 0 } while ((pSrc += 8) < pSrc_end);
2741 0 0 if ((counter &= 7) < 3)
2743 0 0 if (counter)
2746 0 0 if (counter > 1)
2754 0 0 while(counter>2)
2763 0 0 if (counter > 0)
2766 0 0 if (counter > 1)
2772 0 0 } while (!(r->m_final & 1));
2776 0 0 TINFL_SKIP_BITS(32, num_bits & 7);
0 0 TINFL_SKIP_BITS(32, num_bits & 7);
0 0 TINFL_SKIP_BITS(32, num_bits & 7);
0 0 TINFL_SKIP_BITS(32, num_bits & 7);
2777 0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
2785 0 0 if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
2787 0 0 for (counter = 0; counter < 4; ++counter)
2790 0 0 if (num_bits)
2791 0 0 TINFL_GET_BITS(41, s, 8);
0 0 TINFL_GET_BITS(41, s, 8);
0 0 TINFL_GET_BITS(41, s, 8);
0 0 TINFL_GET_BITS(41, s, 8);
2793 0 0 TINFL_GET_BYTE(42, s);
0 0 TINFL_GET_BYTE(42, s);
2805 0 0 if ((status != TINFL_STATUS_NEEDS_MORE_INPUT) && (status != TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS))
0 0 if ((status != TINFL_STATUS_NEEDS_MORE_INPUT) && (status != TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS))
2807 0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
2821 0 0 if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0))
0 0 if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0))
2827 0 0 while (buf_len)
2829 0 0 for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
2840 0 0 for (; i < block_len; ++i)
2847 0 0 if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32))
0 0 if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32))
0 0 if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32))
2864 0 0 tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8 *)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8 *)pBuf, pBuf ? (mz_uint8 *)pBuf + *pOut_len : NULL, &dst_buf_size,
2866 0 0 if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
0 0 if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
2874 0 0 if (status == TINFL_STATUS_DONE)
2877 0 0 if (new_out_buf_capacity < 128)
2880 0 0 if (!pNew_buf)
2898 0 0 return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len;
2907 0 0 if (!pDict)
2916 0 0 if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user)))
0 0 if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user)))
2918 0 0 if (status != TINFL_STATUS_HAS_MORE_OUTPUT)
2934 0 0 if (pDecomp)
3255 0 0 if (pArray->m_capacity >= min_new_capacity)
3257 0 0 if (growing)
3259 0 0 new_capacity = MZ_MAX(1, pArray->m_capacity);
3260 0 0 while (new_capacity < min_new_capacity)
3263 0 0 if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p, pArray->m_element_size, new_capacity)))
3272 0 0 if (new_capacity > pArray->m_capacity)
0 0 if (new_capacity > pArray->m_capacity)
0 0 if (new_capacity > pArray->m_capacity)
3274 0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing))
3282 0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
0 0 if (new_size > pArray->m_capacity)
3284 0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
0 0 if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
3299 0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
0 0 if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
3301 0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
0 0 if (n > 0)
3350 0 0 if (MZ_FILE_STAT(pFilename, &file_stat) != 0)
3374 0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
3382 0 0 if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
0 0 if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
0 0 if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
3385 0 0 if (!pZip->m_pAlloc)
3387 0 0 if (!pZip->m_pFree)
3389 0 0 if (!pZip->m_pRealloc)
3397 0 0 if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
3421 0 0 pE = pL + MZ_MIN(l_len, r_len);
0 0 pE = pL + MZ_MIN(l_len, r_len);
0 0 pE = pL + MZ_MIN(l_len, r_len);
0 0 pE = pL + MZ_MIN(l_len, r_len);
3422 0 0 while (pL < pE)
0 0 while (pL < pE)
0 0 while (pL < pE)
0 0 while (pL < pE)
3424 0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
3429 0 0 return (pL == pE) ? (l_len < r_len) : (l < r);
0 0 return (pL == pE) ? (l_len < r_len) : (l < r);
0 0 return (pL == pE) ? (l_len < r_len) : (l < r);
0 0 return (pL == pE) ? (l_len < r_len) : (l < r);
3451 0 0 if (size <= 1U)
3462 0 0 if ((child = (root << 1U) + 1U) >= size)
3464 0 0 child += (((child + 1U) < size) && (mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U])));
0 0 child += (((child + 1U) < size) && (mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U])));
3465 0 0 if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
3470 0 0 if (!start)
3476 0 0 while (end > 0)
3482 0 0 if ((child = (root << 1U) + 1U) >= end)
3484 0 0 child += (((child + 1U) < end) && mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U]));
0 0 child += (((child + 1U) < end) && mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U]));
3485 0 0 if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
3501 0 0 if (pZip->m_archive_size < record_size)
3508 0 0 int i, n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs);
3510 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n)
3513 0 0 for (i = n - 4; i >= 0; --i)
3516 0 0 if (s == record_sig)
3518 0 0 if ((pZip->m_archive_size - (cur_file_ofs + i)) >= record_size)
3523 0 0 if (i >= 0)
3530 0 0 if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= (MZ_UINT16_MAX + record_size)))
0 0 if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= (MZ_UINT16_MAX + record_size)))
3533 0 0 cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0);
3559 0 0 if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
3562 0 0 if (!mz_zip_reader_locate_header_sig(pZip, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE, &cur_file_ofs))
3566 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
3569 0 0 if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG)
3572 0 0 if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
3574 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs - MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE, pZip64_locator, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE)
3576 0 0 if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG)
3579 0 0 if (zip64_end_of_central_dir_ofs > (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
3582 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, zip64_end_of_central_dir_ofs, pZip64_end_of_central_dir, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)
3584 0 0 if (MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG)
3600 0 0 if (pZip->m_pState->m_zip64)
3608 0 0 if (zip64_size_of_end_of_central_dir_record < (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12))
3611 0 0 if (zip64_total_num_of_disks != 1U)
3615 0 0 if (zip64_cdir_total_entries > MZ_UINT32_MAX)
3620 0 0 if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX)
3626 0 0 if (zip64_size_of_central_directory > MZ_UINT32_MAX)
3638 0 0 if (pZip->m_total_files != cdir_entries_on_this_disk)
3641 0 0 if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1)))
0 0 if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1)))
0 0 if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1)))
3644 0 0 if (cdir_size < pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
3647 0 0 if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size)
3652 0 0 if (pZip->m_total_files)
3656 0 0 if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, MZ_FALSE)) ||
0 0 if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, MZ_FALSE)) ||
3660 0 0 if (sort_central_dir)
3662 0 0 if (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))
3666 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size)
3671 0 0 for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i)
3676 0 0 if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG))
0 0 if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG))
3681 0 0 if (sort_central_dir)
3690 0 0 if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
0 0 if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
3691 0 0 (ext_data_size) &&
3697 0 0 if (extra_size_remaining)
3702 0 0 if (MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + ext_data_size > n)
3705 0 0 if(buf==NULL)
3708 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size, buf, ext_data_size) != ext_data_size)
3726 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
3735 0 0 if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
3741 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
3751 0 0 } while (extra_size_remaining);
3758 0 0 if ((comp_size != MZ_UINT32_MAX) && (decomp_size != MZ_UINT32_MAX))
0 0 if ((comp_size != MZ_UINT32_MAX) && (decomp_size != MZ_UINT32_MAX))
3760 0 0 if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size))
0 0 if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size))
0 0 if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size))
0 0 if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size))
3765 0 0 if ((disk_index == MZ_UINT16_MAX) || ((disk_index != num_this_disk) && (disk_index != 1)))
0 0 if ((disk_index == MZ_UINT16_MAX) || ((disk_index != num_this_disk) && (disk_index != 1)))
0 0 if ((disk_index == MZ_UINT16_MAX) || ((disk_index != num_this_disk) && (disk_index != 1)))
3768 0 0 if (comp_size != MZ_UINT32_MAX)
3770 0 0 if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size)
3775 0 0 if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED)
3778 0 0 if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) > n)
3786 0 0 if (sort_central_dir)
3794 0 0 if (pZip)
3802 0 0 if (!pZip)
3805 0 0 if ((!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
0 0 if ((!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
0 0 if ((!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
0 0 if ((!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
3807 0 0 if (set_last_error)
3813 0 0 if (pZip->m_pState)
3823 0 0 if (pState->m_pFile)
3825 0 0 if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
3827 0 0 if (MZ_FCLOSE(pState->m_pFile) == EOF)
3829 0 0 if (set_last_error)
3851 0 0 if ((!pZip) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pRead))
3854 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
3860 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
3872 0 0 size_t s = (file_ofs >= pZip->m_archive_size) ? 0 : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n);
3879 0 0 if (!pMem)
3882 0 0 if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
3885 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
3902 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
3919 0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
3935 0 0 if ((!pZip) || (!pFilename) || ((archive_size) && (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
0 0 if ((!pZip) || (!pFilename) || ((archive_size) && (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
0 0 if ((!pZip) || (!pFilename) || ((archive_size) && (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
0 0 if ((!pZip) || (!pFilename) || ((archive_size) && (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
3939 0 0 if (!pFile)
3943 0 0 if (!file_size)
3945 0 0 if (MZ_FSEEK64(pFile, 0, SEEK_END))
3956 0 0 if (file_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
3962 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
3975 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
3988 0 0 if ((!pZip) || (!pFile))
0 0 if ((!pZip) || (!pFile))
3993 0 0 if (!archive_size)
3995 0 0 if (MZ_FSEEK64(pFile, 0, SEEK_END))
4000 0 0 if (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
4004 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
4015 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
4028 0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
0 0 if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
4037 0 0 if (!p)
4053 0 0 if (!p)
4062 0 0 if ((method != 0) && (method != MZ_DEFLATED))
0 0 if ((method != 0) && (method != MZ_DEFLATED))
4068 0 0 if (bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION))
4074 0 0 if (bit_flag & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG)
4087 0 0 if (!p)
4094 0 0 if (filename_len)
4096 0 0 if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/')
4107 0 0 if ((external_attr & MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG) != 0)
4120 0 0 if (pFound_zip64_extra_data)
4123 0 0 if ((!p) || (!pStat))
0 0 if ((!p) || (!pStat))
4162 0 0 if (MZ_MAX(MZ_MAX(pStat->m_comp_size, pStat->m_uncomp_size), pStat->m_local_header_ofs) == MZ_UINT32_MAX)
4167 0 0 if (extra_size_remaining)
4176 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
4182 0 0 if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
4185 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
4190 0 0 if (pFound_zip64_extra_data)
4193 0 0 if (pStat->m_uncomp_size == MZ_UINT32_MAX)
4195 0 0 if (field_data_remaining < sizeof(mz_uint64))
4203 0 0 if (pStat->m_comp_size == MZ_UINT32_MAX)
4205 0 0 if (field_data_remaining < sizeof(mz_uint64))
4213 0 0 if (pStat->m_local_header_ofs == MZ_UINT32_MAX)
4215 0 0 if (field_data_remaining < sizeof(mz_uint64))
4228 0 0 } while (extra_size_remaining);
4238 0 0 if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE)
0 0 if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE)
4240 0 0 for (i = 0; i < len; ++i)
0 0 for (i = 0; i < len; ++i)
4241 0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
0 0 if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
4252 0 0 pE = pL + MZ_MIN(l_len, r_len);
4253 0 0 while (pL < pE)
4255 0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
0 0 if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
4260 0 0 return (pL == pE) ? (int)(l_len - r_len) : (l - r);
4272 0 0 if (pIndex)
4275 0 0 if (size)
4281 0 0 while (l <= h)
4287 0 0 if (!comp)
4289 0 0 if (pIndex)
4293 0 0 else if (comp < 0)
4306 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pName, pComment, flags, &index))
4317 0 0 if (pIndex)
4320 0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
4324 0 0 if (((pZip->m_pState->m_init_flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0) &&
0 0 if (((pZip->m_pState->m_init_flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0) &&
4325 0 0 (pZip->m_zip_mode == MZ_ZIP_MODE_READING) &&
4326 0 0 ((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE)) == 0) && (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_size))
0 0 ((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE)) == 0) && (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_size))
4333 0 0 if (name_len > MZ_UINT16_MAX)
4336 0 0 comment_len = pComment ? strlen(pComment) : 0;
4337 0 0 if (comment_len > MZ_UINT16_MAX)
4340 0 0 for (file_index = 0; file_index < pZip->m_total_files; file_index++)
4345 0 0 if (filename_len < name_len)
4347 0 0 if (comment_len)
4351 0 0 if ((file_comment_len != comment_len) || (!mz_zip_string_equal(pComment, pFile_comment, file_comment_len, flags)))
0 0 if ((file_comment_len != comment_len) || (!mz_zip_string_equal(pComment, pFile_comment, file_comment_len, flags)))
4354 0 0 if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len))
0 0 if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len))
4359 0 0 if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') || (pFilename[ofs] == ':'))
0 0 if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') || (pFilename[ofs] == ':'))
0 0 if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') || (pFilename[ofs] == ':'))
4361 0 0 } while (--ofs >= 0);
4366 0 0 if ((filename_len == name_len) && (mz_zip_string_equal(pName, pFilename, filename_len, flags)))
0 0 if ((filename_len == name_len) && (mz_zip_string_equal(pName, pFilename, filename_len, flags)))
4368 0 0 if (pIndex)
4387 0 0 if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
4390 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4394 0 0 if ((file_stat.m_is_directory) || (!file_stat.m_comp_size))
0 0 if ((file_stat.m_is_directory) || (!file_stat.m_comp_size))
4398 0 0 if (file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG))
4402 0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
4406 0 0 needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size;
4407 0 0 if (buf_size < needed_size)
4412 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
4415 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4419 0 0 if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
4422 0 0 if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method))
0 0 if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method))
4425 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, (size_t)needed_size) != needed_size)
4429 0 0 if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) == 0)
4431 0 0 if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
4442 0 0 if (pZip->m_pState->m_pMem)
4449 0 0 else if (pUser_read_buf)
4452 0 0 if (!user_read_buf_size)
4466 0 0 if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
4477 0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
4480 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4491 0 0 status = tinfl_decompress(&inflator, (mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pBuf, (mz_uint8 *)pBuf + out_buf_ofs, &out_buf_size, TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF | (comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0));
4495 0 0 } while (status == TINFL_STATUS_NEEDS_MORE_INPUT);
4497 0 0 if (status == TINFL_STATUS_DONE)
4500 0 0 if (out_buf_ofs != file_stat.m_uncomp_size)
4506 0 0 else if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
4514 0 0 if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
0 0 if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
4523 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4544 0 0 if (pSize)
4547 0 0 if (!p)
4556 0 0 alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? comp_size : uncomp_size;
4563 0 0 if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size)))
4569 0 0 if (!mz_zip_reader_extract_to_mem(pZip, file_index, pBuf, (size_t)alloc_size, flags))
4575 0 0 if (pSize)
4583 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4585 0 0 if (pSize)
4603 0 0 if ((!pZip) || (!pZip->m_pState) || (!pCallback) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pCallback) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pCallback) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pCallback) || (!pZip->m_pRead))
4606 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4610 0 0 if ((file_stat.m_is_directory) || (!file_stat.m_comp_size))
0 0 if ((file_stat.m_is_directory) || (!file_stat.m_comp_size))
4614 0 0 if (file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG))
4618 0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
4623 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
4626 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4630 0 0 if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
4634 0 0 if (pZip->m_pState->m_pMem)
4643 0 0 if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
4650 0 0 if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method))
0 0 if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method))
4653 0 0 if (pZip->m_pState->m_pMem)
4658 0 0 if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size)
4663 0 0 else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
4676 0 0 while (comp_remaining)
4679 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4687 0 0 if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
4693 0 0 if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4711 0 0 if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
4722 0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
4725 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4737 0 0 status = tinfl_decompress(&inflator, (const mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pWrite_buf, pWrite_buf_cur, &out_buf_size, comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0);
4741 0 0 if (out_buf_size)
4743 0 0 if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size)
4753 0 0 if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size)
4760 0 0 } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) || (status == TINFL_STATUS_HAS_MORE_OUTPUT));
0 0 } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) || (status == TINFL_STATUS_HAS_MORE_OUTPUT));
4764 0 0 if ((status == TINFL_STATUS_DONE) && (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
0 0 if ((status == TINFL_STATUS_DONE) && (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
4767 0 0 if (out_buf_ofs != file_stat.m_uncomp_size)
4773 0 0 else if (file_crc32 != file_stat.m_crc32)
4781 0 0 if (!pZip->m_pState->m_pMem)
4784 0 0 if (pWrite_buf)
4793 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4806 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
4811 0 0 if (!pState)
4818 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &pState->file_stat))
4825 0 0 if (pState->file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG))
4833 0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (pState->file_stat.m_method != 0) && (pState->file_stat.m_method != MZ_DEFLATED))
0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (pState->file_stat.m_method != 0) && (pState->file_stat.m_method != MZ_DEFLATED))
0 0 if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (pState->file_stat.m_method != 0) && (pState->file_stat.m_method != MZ_DEFLATED))
4857 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, pState->cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
4864 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4872 0 0 if ((pState->cur_file_ofs + pState->file_stat.m_comp_size) > pZip->m_archive_size)
4880 0 0 if (pZip->m_pState->m_pMem)
4888 0 0 if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method)))
0 0 if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method)))
4892 0 0 if (NULL == (pState->pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)pState->read_buf_size)))
4908 0 0 if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method)))
0 0 if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method)))
4914 0 0 if (NULL == (pState->pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
4917 0 0 if (pState->pRead_buf)
4932 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4944 0 0 if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState) || (!pvBuf))
0 0 if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState) || (!pvBuf))
0 0 if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState) || (!pvBuf))
0 0 if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState) || (!pvBuf))
4947 0 0 if ((pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method))
0 0 if ((pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method))
4953 0 0 if (pState->pZip->m_pState->m_pMem)
4962 0 0 if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pvBuf, copied_to_caller) != copied_to_caller)
4973 0 0 if (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
4992 0 0 if (!pState->out_blk_remain)
4995 0 0 if ((!pState->read_buf_avail) && (!pState->pZip->m_pState->m_pMem))
0 0 if ((!pState->read_buf_avail) && (!pState->pZip->m_pState->m_pMem))
4999 0 0 if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pState->pRead_buf, (size_t)pState->read_buf_avail) != pState->read_buf_avail)
5014 0 0 pState->status = tinfl_decompress(&pState->inflator, (const mz_uint8 *)pState->pRead_buf + pState->read_buf_ofs, &in_buf_size, (mz_uint8 *)pState->pWrite_buf, pWrite_buf_cur, &out_buf_size, pState->comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0);
5022 0 0 if (pState->out_blk_remain)
5039 0 0 if ((pState->out_buf_ofs += to_copy) > pState->file_stat.m_uncomp_size)
5049 0 0 } while ( (copied_to_caller < buf_size) && ((pState->status == TINFL_STATUS_NEEDS_MORE_INPUT) || (pState->status == TINFL_STATUS_HAS_MORE_OUTPUT)) );
0 0 } while ( (copied_to_caller < buf_size) && ((pState->status == TINFL_STATUS_NEEDS_MORE_INPUT) || (pState->status == TINFL_STATUS_HAS_MORE_OUTPUT)) );
0 0 } while ( (copied_to_caller < buf_size) && ((pState->status == TINFL_STATUS_NEEDS_MORE_INPUT) || (pState->status == TINFL_STATUS_HAS_MORE_OUTPUT)) );
5061 0 0 if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState))
0 0 if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState))
0 0 if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState))
5065 0 0 if ((pState->status == TINFL_STATUS_DONE) && (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
0 0 if ((pState->status == TINFL_STATUS_DONE) && (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
5068 0 0 if (pState->out_buf_ofs != pState->file_stat.m_uncomp_size)
5074 0 0 else if (pState->file_crc32 != pState->file_stat.m_crc32)
5083 0 0 if (!pState->pZip->m_pState->m_pMem)
5085 0 0 if (pState->pWrite_buf)
5111 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
5114 0 0 if ((file_stat.m_is_directory) || (!file_stat.m_is_supported))
0 0 if ((file_stat.m_is_directory) || (!file_stat.m_is_supported))
5118 0 0 if (!pFile)
5123 0 0 if (MZ_FCLOSE(pFile) == EOF)
5125 0 0 if (status)
5132 0 0 if (status)
5142 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pArchive_filename, NULL, flags, &file_index))
5152 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
5155 0 0 if ((file_stat.m_is_directory) || (!file_stat.m_is_supported))
0 0 if ((file_stat.m_is_directory) || (!file_stat.m_is_supported))
5164 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pArchive_filename, NULL, flags, &file_index))
5198 0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
5201 0 0 if (file_index > pZip->m_total_files)
5208 0 0 if (!mz_zip_file_stat_internal(pZip, file_index, pCentral_dir_header, &file_stat, &found_zip64_ext_data_in_cdir))
5212 0 0 if ((file_stat.m_is_directory) || (!file_stat.m_uncomp_size))
0 0 if ((file_stat.m_is_directory) || (!file_stat.m_uncomp_size))
5216 0 0 if (file_stat.m_is_encrypted)
5220 0 0 if ((file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
0 0 if ((file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
5223 0 0 if (!file_stat.m_is_supported)
5228 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
5231 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
5242 0 0 if (local_header_filename_len != strlen(file_stat.m_filename))
5245 0 0 if ((local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size) > pZip->m_archive_size)
5248 0 0 if (!mz_zip_array_resize(pZip, &file_data_array, MZ_MAX(local_header_filename_len, local_header_extra_len), MZ_FALSE))
5251 0 0 if (local_header_filename_len)
5253 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE, file_data_array.m_p, local_header_filename_len) != local_header_filename_len)
5260 0 0 if (memcmp(file_stat.m_filename, file_data_array.m_p, local_header_filename_len) != 0)
5267 0 0 if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
0 0 if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
0 0 if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
5272 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len, file_data_array.m_p, local_header_extra_len) != local_header_extra_len)
5282 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
5289 0 0 if (field_total_size > extra_size_remaining)
5292 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
5296 0 0 if (field_data_size < sizeof(mz_uint64) * 2)
5311 0 0 } while (extra_size_remaining);
5316 0 0 if ((has_data_descriptor) && (!local_header_comp_size) && (!local_header_crc32))
0 0 if ((has_data_descriptor) && (!local_header_comp_size) && (!local_header_crc32))
0 0 if ((has_data_descriptor) && (!local_header_comp_size) && (!local_header_crc32))
5324 0 0 mz_uint32 num_descriptor_uint32s = ((pState->m_zip64) || (found_zip64_ext_data_in_ldir)) ? 6 : 4;
0 0 mz_uint32 num_descriptor_uint32s = ((pState->m_zip64) || (found_zip64_ext_data_in_ldir)) ? 6 : 4;
5326 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size, descriptor_buf, sizeof(mz_uint32) * num_descriptor_uint32s) != (sizeof(mz_uint32) * num_descriptor_uint32s))
5333 0 0 pSrc = has_id ? (descriptor_buf + sizeof(mz_uint32)) : descriptor_buf;
5337 0 0 if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
0 0 if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
5348 0 0 if ((file_crc32 != file_stat.m_crc32) || (comp_size != file_stat.m_comp_size) || (uncomp_size != file_stat.m_uncomp_size))
0 0 if ((file_crc32 != file_stat.m_crc32) || (comp_size != file_stat.m_comp_size) || (uncomp_size != file_stat.m_uncomp_size))
0 0 if ((file_crc32 != file_stat.m_crc32) || (comp_size != file_stat.m_comp_size) || (uncomp_size != file_stat.m_uncomp_size))
5356 0 0 if ((local_header_crc32 != file_stat.m_crc32) || (local_header_comp_size != file_stat.m_comp_size) || (local_header_uncomp_size != file_stat.m_uncomp_size))
0 0 if ((local_header_crc32 != file_stat.m_crc32) || (local_header_comp_size != file_stat.m_comp_size) || (local_header_uncomp_size != file_stat.m_uncomp_size))
0 0 if ((local_header_crc32 != file_stat.m_crc32) || (local_header_comp_size != file_stat.m_comp_size) || (local_header_uncomp_size != file_stat.m_uncomp_size))
5365 0 0 if ((flags & MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY) == 0)
5367 0 0 if (!mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_compute_crc32_callback, &uncomp_crc32, 0))
5371 0 0 if (uncomp_crc32 != file_stat.m_crc32)
5390 0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
5396 0 0 if (!pState->m_zip64)
5398 0 0 if (pZip->m_total_files > MZ_UINT16_MAX)
5401 0 0 if (pZip->m_archive_size > MZ_UINT32_MAX)
5406 0 0 if (pZip->m_total_files >= MZ_UINT32_MAX)
5409 0 0 if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
5413 0 0 for (i = 0; i < pZip->m_total_files; i++)
5415 0 0 if (MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG & flags)
5420 0 0 if (!mz_zip_reader_file_stat(pZip, i, &stat))
5423 0 0 if (!mz_zip_reader_locate_file_v2(pZip, stat.m_filename, NULL, 0, &found_index))
5427 0 0 if (found_index != i)
5431 0 0 if (!mz_zip_validate_file(pZip, i, flags))
5444 0 0 if ((!pMem) || (!size))
0 0 if ((!pMem) || (!size))
5446 0 0 if (pErr)
5453 0 0 if (!mz_zip_reader_init_mem(&zip, pMem, size, flags))
5455 0 0 if (pErr)
5460 0 0 if (!mz_zip_validate_archive(&zip, flags))
5466 0 0 if (!mz_zip_reader_end_internal(&zip, success))
5468 0 0 if (!actual_err)
5473 0 0 if (pErr)
5486 0 0 if (!pFilename)
5488 0 0 if (pErr)
5495 0 0 if (!mz_zip_reader_init_file_v2(&zip, pFilename, flags, 0, 0))
5497 0 0 if (pErr)
5502 0 0 if (!mz_zip_validate_archive(&zip, flags))
5508 0 0 if (!mz_zip_reader_end_internal(&zip, success))
5510 0 0 if (!actual_err)
5515 0 0 if (pErr)
5554 0 0 if (!n)
5564 0 0 if (new_size > pState->m_mem_capacity)
5569 0 0 while (new_capacity < new_size)
5572 0 0 if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity)))
5591 0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
5593 0 0 if (set_last_error)
5605 0 0 if (pState->m_pFile)
5607 0 0 if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
5609 0 0 if (MZ_FCLOSE(pState->m_pFile) == EOF)
5611 0 0 if (set_last_error)
5621 0 0 if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem))
0 0 if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem))
5636 0 0 if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
0 0 if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
0 0 if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
0 0 if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
5639 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5641 0 0 if (!pZip->m_pRead)
5645 0 0 if (pZip->m_file_offset_alignment)
5648 0 0 if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1))
5652 0 0 if (!pZip->m_pAlloc)
5654 0 0 if (!pZip->m_pFree)
5656 0 0 if (!pZip->m_pRealloc)
5663 0 0 if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
5691 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5696 0 0 if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
5701 0 0 if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning)))
5703 0 0 if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size)))
5727 0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
5748 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5753 0 0 if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
5756 0 0 if (NULL == (pFile = MZ_FOPEN(pFilename, (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) ? "w+b" : "wb")))
0 0 if (NULL == (pFile = MZ_FOPEN(pFilename, (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) ? "w+b" : "wb")))
5765 0 0 if (size_to_reserve_at_beginning)
5775 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_ofs, buf, n) != n)
5782 0 0 } while (size_to_reserve_at_beginning);
5793 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5798 0 0 if (!mz_zip_writer_init_v2(pZip, 0, flags))
5813 0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
5816 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ZIP64)
5819 0 0 if (!pZip->m_pState->m_zip64)
5824 0 0 if (pZip->m_pState->m_zip64)
5826 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
5831 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
5834 0 0 if ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX)
5840 0 0 if (pState->m_pFile)
5846 0 0 if (pZip->m_pIO_opaque != pZip)
5849 0 0 if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
5851 0 0 if (!pFilename)
5855 0 0 if (NULL == (pState->m_pFile = MZ_FREOPEN(pFilename, "r+b", pState->m_pFile)))
5867 0 0 else if (pState->m_pMem)
5870 0 0 if (pZip->m_pIO_opaque != pZip)
5878 0 0 else if (!pZip->m_pWrite)
5917 0 0 if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque, pState->m_cur_archive_file_ofs, pBuf, len) != len)
5936 0 0 if (pUncomp_size)
5943 0 0 if (pComp_size)
5950 0 0 if (pLocal_header_ofs)
5967 0 0 MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0);
5973 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
5974 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
5989 0 0 MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0);
5995 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
5996 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
6001 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_MIN(local_header_ofs, MZ_UINT32_MAX));
6017 0 0 if (!pZip->m_pState->m_zip64)
6019 0 0 if (local_header_ofs > 0xFFFFFFFF)
6024 0 0 if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + extra_size + user_extra_data_len + comment_size) >= MZ_UINT32_MAX)
6027 0 0 if (!mz_zip_writer_create_central_dir_header(pZip, central_dir_header, filename_size, (mz_uint16)(extra_size + user_extra_data_len), comment_size, uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time, dos_date, local_header_ofs, ext_attributes))
6030 0 0 if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) ||
0 0 if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) ||
6031 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) ||
6032 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) ||
6033 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, user_extra_data, user_extra_data_len)) ||
6034 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) ||
6048 0 0 if (*pArchive_name == '/')
6059 0 0 if (!pZip->m_file_offset_alignment)
6068 0 0 memset(buf, 0, MZ_MIN(sizeof(buf), n));
6069 0 0 while (n)
6072 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s)
6104 0 0 if ((int)level_and_flags < 0)
6107 0 0 if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
0 0 if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
0 0 if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
6110 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
6114 0 0 store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA));
0 0 store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA));
6116 0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
6121 0 0 if (pState->m_zip64)
6123 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6128 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6133 0 0 if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
0 0 if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
6140 0 0 if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size))
0 0 if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size))
6143 0 0 if (!mz_zip_writer_validate_archive_name(pArchive_name))
6147 0 0 if (last_modified != NULL)
6159 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
6163 0 0 if (uncomp_size <= 3)
6171 0 0 if (archive_name_size > MZ_UINT16_MAX)
6177 0 0 if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX)
6180 0 0 if (!pState->m_zip64)
6183 0 0 if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size
6193 0 0 if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
0 0 if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
6199 0 0 if ((buf_size) || (uncomp_size))
0 0 if ((buf_size) || (uncomp_size))
6204 0 0 if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + (pState->m_zip64 ? MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE : 0))) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1)))
0 0 if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + (pState->m_zip64 ? MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE : 0))) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1)))
0 0 if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + (pState->m_zip64 ? MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE : 0))) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1)))
6207 0 0 if ((!store_data_uncompressed) && (buf_size))
0 0 if ((!store_data_uncompressed) && (buf_size))
6209 0 0 if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor))))
6213 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
6228 0 0 if (!store_data_uncompressed || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
0 0 if (!store_data_uncompressed || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
6233 0 0 if (pState->m_zip64)
6235 0 0 if (uncomp_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
0 0 if (uncomp_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
6238 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6242 0 0 if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len), 0, 0, 0, method, bit_flags, dos_time, dos_date))
6245 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
6250 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6257 0 0 if (pExtra_data != NULL)
6259 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
6267 0 0 if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX))
0 0 if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX))
6269 0 0 if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)user_extra_data_len, 0, 0, 0, method, bit_flags, dos_time, dos_date))
6272 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
6277 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6285 0 0 if (user_extra_data_len > 0)
6287 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len)
6293 0 0 if (store_data_uncompressed)
6295 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size)
6304 0 0 else if (buf_size)
6326 0 0 if (uncomp_size)
6335 0 0 if (pExtra_data == NULL)
6337 0 0 if (comp_size > MZ_UINT32_MAX)
6350 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size)
6356 0 0 if (pExtra_data != NULL)
6358 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6362 0 0 if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, pExtra_data, (mz_uint16)extra_size, pComment,
6388 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
6391 0 0 if ((int)level_and_flags < 0)
6396 0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
6401 0 0 if ((!pState->m_zip64) && (uncomp_size > MZ_UINT32_MAX))
0 0 if ((!pState->m_zip64) && (uncomp_size > MZ_UINT32_MAX))
6409 0 0 if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
6412 0 0 if (!mz_zip_writer_validate_archive_name(pArchive_name))
6415 0 0 if (pState->m_zip64)
6417 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6422 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6430 0 0 if (archive_name_size > MZ_UINT16_MAX)
6436 0 0 if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX)
6439 0 0 if (!pState->m_zip64)
6442 0 0 if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE
6452 0 0 if (pFile_time)
6458 0 0 if (uncomp_size <= 3)
6461 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
6474 0 0 if (uncomp_size && level)
0 0 if (uncomp_size && level)
6480 0 0 if (pState->m_zip64)
6482 0 0 if (uncomp_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
0 0 if (uncomp_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
6485 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6489 0 0 if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len), 0, 0, 0, method, gen_flags, dos_time, dos_date))
6492 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
6497 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6504 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
6511 0 0 if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX))
0 0 if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX))
6513 0 0 if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)user_extra_data_len, 0, 0, 0, method, gen_flags, dos_time, dos_date))
6516 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
6521 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6529 0 0 if (user_extra_data_len > 0)
6531 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len)
6537 0 0 if (uncomp_size)
6541 0 0 if (!pRead_buf)
6546 0 0 if (!level)
6548 0 0 while (uncomp_remaining)
6550 0 0 mz_uint n = (mz_uint)MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, uncomp_remaining);
6551 0 0 if ((read_callback(callback_opaque, file_ofs, pRead_buf, n) != n) || (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n))
0 0 if ((read_callback(callback_opaque, file_ofs, pRead_buf, n) != n) || (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n))
6568 0 0 if (!pComp)
6578 0 0 if (tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY)
6587 0 0 size_t in_buf_size = (mz_uint32)MZ_MIN(uncomp_remaining, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE);
6591 0 0 if (read_callback(callback_opaque, file_ofs, pRead_buf, in_buf_size)!= in_buf_size)
6601 0 0 if (pZip->m_pNeeds_keepalive != NULL && pZip->m_pNeeds_keepalive(pZip->m_pIO_opaque))
0 0 if (pZip->m_pNeeds_keepalive != NULL && pZip->m_pNeeds_keepalive(pZip->m_pIO_opaque))
6604 0 0 status = tdefl_compress_buffer(pComp, pRead_buf, in_buf_size, uncomp_remaining ? flush : TDEFL_FINISH);
6605 0 0 if (status == TDEFL_STATUS_DONE)
6610 0 0 else if (status != TDEFL_STATUS_OKAY)
6619 0 0 if (!result)
6638 0 0 if (pExtra_data == NULL)
6640 0 0 if (comp_size > MZ_UINT32_MAX)
6653 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size)
6659 0 0 if (pExtra_data != NULL)
6661 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6665 0 0 if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, pExtra_data, (mz_uint16)extra_size, pComment, comment_size,
6683 0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pSrc_file, (mz_int64)file_ofs, SEEK_SET))))
0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pSrc_file, (mz_int64)file_ofs, SEEK_SET))))
0 0 if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pSrc_file, (mz_int64)file_ofs, SEEK_SET))))
6708 0 0 if (!mz_zip_get_file_modified_time(pSrc_filename, &file_modified_time))
6713 0 0 if (!pSrc_file)
6731 0 0 if (!mz_zip_array_reserve(pZip, pNew_ext, ext_len + 64, MZ_FALSE))
6736 0 0 if ((pUncomp_size) || (pComp_size) || (pLocal_header_ofs) || (pDisk_start))
0 0 if ((pUncomp_size) || (pComp_size) || (pLocal_header_ofs) || (pDisk_start))
0 0 if ((pUncomp_size) || (pComp_size) || (pLocal_header_ofs) || (pDisk_start))
0 0 if ((pUncomp_size) || (pComp_size) || (pLocal_header_ofs) || (pDisk_start))
6744 0 0 if (pUncomp_size)
6750 0 0 if (pComp_size)
6756 0 0 if (pLocal_header_ofs)
6762 0 0 if (pDisk_start)
6770 0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, new_ext_block, pDst - new_ext_block))
6774 0 0 if ((pExt) && (ext_len))
0 0 if ((pExt) && (ext_len))
6783 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
6790 0 0 if (field_total_size > extra_size_remaining)
6793 0 0 if (field_id != MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
6795 0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, pExtra_data, field_total_size))
6801 0 0 } while (extra_size_remaining);
6827 0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pSource_zip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pSource_zip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pSource_zip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pSource_zip->m_pRead))
6833 0 0 if ((pSource_zip->m_pState->m_zip64) && (!pZip->m_pState->m_zip64))
0 0 if ((pSource_zip->m_pState->m_zip64) && (!pZip->m_pState->m_zip64))
6837 0 0 if (NULL == (pSrc_central_header = mz_zip_get_cdh(pSource_zip, src_file_index)))
6840 0 0 if (MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_SIG_OFS) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)
6849 0 0 if ((pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_central_dir_following_data_size + 32) >= MZ_UINT32_MAX)
6854 0 0 if (!pState->m_zip64)
6856 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6862 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6866 0 0 if (!mz_zip_file_stat_internal(pSource_zip, src_file_index, pSrc_central_header, &src_file_stat, NULL))
6873 0 0 if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
6876 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
6889 0 0 if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
0 0 if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
0 0 if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
6896 0 0 if (!mz_zip_array_resize(pZip, &file_data_array, local_header_extra_len, MZ_FALSE))
6901 0 0 if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, src_file_stat.m_local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_size, file_data_array.m_p, local_header_extra_len) != local_header_extra_len)
6913 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
6923 0 0 if (field_total_size > extra_size_remaining)
6929 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
6933 0 0 if (field_data_size < sizeof(mz_uint64) * 2)
6948 0 0 } while (extra_size_remaining);
6953 0 0 if (!pState->m_zip64)
6960 0 0 if (approx_new_archive_size >= MZ_UINT32_MAX)
6965 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs, num_alignment_padding_bytes))
6977 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
6983 0 0 if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)MZ_MAX(32U, MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining)))))
0 0 if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)MZ_MAX(32U, MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining)))))
6986 0 0 while (src_archive_bytes_remaining)
6988 0 0 n = (mz_uint)MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining);
6989 0 0 if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, n) != n)
6996 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
7008 0 0 if (bit_flags & 8)
7011 0 0 if ((pSource_zip->m_pState->m_zip64) || (found_zip64_ext_data_in_ldir))
0 0 if ((pSource_zip->m_pState->m_zip64) || (found_zip64_ext_data_in_ldir))
7020 0 0 if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, (sizeof(mz_uint32) * 6)) != (sizeof(mz_uint32) * 6))
7026 0 0 n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == MZ_ZIP_DATA_DESCRIPTOR_ID) ? 6 : 5);
7033 0 0 if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, sizeof(mz_uint32) * 4) != sizeof(mz_uint32) * 4)
7041 0 0 if (pZip->m_pState->m_zip64)
7044 0 0 const mz_uint32 *pSrc_descriptor = (const mz_uint32 *)((const mz_uint8 *)pBuf + (has_id ? sizeof(mz_uint32) : 0));
7059 0 0 n = sizeof(mz_uint32) * (has_id ? 4 : 3);
7063 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
7079 0 0 if (pState->m_zip64)
7091 0 0 if (!mz_zip_writer_update_zip64_extension_block(&new_ext_block, pZip, pSrc_ext, src_ext_len, &src_file_stat.m_comp_size, &src_file_stat.m_uncomp_size, &local_dir_header_ofs, NULL))
7099 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
7105 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, src_filename_len))
7112 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_ext_block.m_p, new_ext_block.m_size))
7119 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_filename_len + src_ext_len, src_comment_len))
7131 0 0 if (cur_dst_file_ofs > MZ_UINT32_MAX)
7134 0 0 if (local_dir_header_ofs >= MZ_UINT32_MAX)
7139 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
7142 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, src_central_dir_following_data_size))
7150 0 0 if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
7158 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1))
7176 0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING))
0 0 if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING))
7181 0 0 if (pState->m_zip64)
7183 0 0 if ((pZip->m_total_files > MZ_UINT32_MAX) || (pState->m_central_dir.m_size >= MZ_UINT32_MAX))
7188 0 0 if ((pZip->m_total_files > MZ_UINT16_MAX) || ((pZip->m_archive_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX))
0 0 if ((pZip->m_total_files > MZ_UINT16_MAX) || ((pZip->m_archive_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX))
7194 0 0 if (pZip->m_total_files)
7200 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, central_dir_ofs, pState->m_central_dir.m_p, (size_t)central_dir_size) != central_dir_size)
7206 0 0 if (pState->m_zip64)
7220 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)
7230 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) != MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE)
7239 0 0 MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
7240 0 0 MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
7241 0 0 MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_size));
7242 0 0 MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_ofs));
7244 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
7248 0 0 if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF))
0 0 if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF))
7260 0 0 if ((!ppBuf) || (!pSize))
0 0 if ((!ppBuf) || (!pSize))
7266 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7269 0 0 if (pZip->m_pWrite != mz_zip_heap_write_func)
7272 0 0 if (!mz_zip_writer_finalize_archive(pZip))
7302 0 0 if ((int)level_and_flags < 0)
7305 0 0 if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
0 0 if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
0 0 if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
0 0 if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
0 0 if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
0 0 if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
0 0 if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
7307 0 0 if (pErr)
7312 0 0 if (!mz_zip_writer_validate_archive_name(pArchive_name))
7314 0 0 if (pErr)
7321 0 0 if (MZ_FILE_STAT(pZip_filename, &file_stat) != 0)
7324 0 0 if (!mz_zip_writer_init_file_v2(&zip_archive, pZip_filename, 0, level_and_flags))
7326 0 0 if (pErr)
7336 0 0 if (!mz_zip_reader_init_file_v2(&zip_archive, pZip_filename, level_and_flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY, 0, 0))
7338 0 0 if (pErr)
7343 0 0 if (!mz_zip_writer_init_from_reader_v2(&zip_archive, pZip_filename, level_and_flags))
7345 0 0 if (pErr)
7358 0 0 if (!mz_zip_writer_finalize_archive(&zip_archive))
7360 0 0 if (!actual_err)
7366 0 0 if (!mz_zip_writer_end_internal(&zip_archive, status))
7368 0 0 if (!actual_err)
7374 0 0 if ((!status) && (created_new_archive))
0 0 if ((!status) && (created_new_archive))
7381 0 0 if (pErr)
7393 0 0 if (pSize)
7396 0 0 if ((!pZip_filename) || (!pArchive_name))
0 0 if ((!pZip_filename) || (!pArchive_name))
7398 0 0 if (pErr)
7405 0 0 if (!mz_zip_reader_init_file_v2(&zip_archive, pZip_filename, flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY, 0, 0))
7407 0 0 if (pErr)
7413 0 0 if (mz_zip_reader_locate_file_v2(&zip_archive, pArchive_name, pComment, flags, &file_index))
7420 0 0 if (pErr)
7439 0 0 return pZip ? pZip->m_zip_mode : MZ_ZIP_MODE_INVALID;
7444 0 0 return pZip ? pZip->m_zip_type : MZ_ZIP_TYPE_INVALID;
7451 0 0 if (!pZip)
7462 0 0 if (!pZip)
7477 0 0 if (!pZip)
7564 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7572 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7580 0 0 return pZip ? pZip->m_total_files : 0;
7585 0 0 if (!pZip)
7592 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7599 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7606 0 0 if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pZip->m_pRead))
7616 0 0 if (!p)
7618 0 0 if (filename_buf_size)
7624 0 0 if (filename_buf_size)
7640 0 0 if (!pZip)
7643 0 0 if (pZip->m_zip_mode == MZ_ZIP_MODE_READING)
7646 0 0 else if ((pZip->m_zip_mode == MZ_ZIP_MODE_WRITING) || (pZip->m_zip_mode == MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED))
0 0 else if ((pZip->m_zip_mode == MZ_ZIP_MODE_WRITING) || (pZip->m_zip_mode == MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED))