Branch Coverage

miniz.c
Criterion Covered Total %
branch 388 3378 11.4


line true false branch
44 0 73890 if (!ptr)
46 250938 73890 while (buf_len)
48 132656820 250938 for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
59 293880 250938 for (; i < block_len; ++i)
141 0 0 while (buf_len >= 4)
151 0 0 while (buf_len)
202 0 73890 if (!pStream)
204 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)))
213 73890 0 if (!pStream->zalloc)
215 73890 0 if (!pStream->zfree)
219 0 73890 if (!pComp)
224 0 73890 if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY)
235 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))
248 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))
250 0 73890 if (!pStream->avail_out)
253 0 73890 if (flush == MZ_PARTIAL_FLUSH)
256 0 73890 if (((tdefl_compressor *)pStream->state)->m_prev_return_status == TDEFL_STATUS_DONE)
257 0 0 return (flush == MZ_FINISH) ? MZ_STREAM_END : MZ_BUF_ERROR;
277 0 73890 if (defl_status < 0)
282 73890 0 else if (defl_status == TDEFL_STATUS_DONE)
287 0 0 else if (!pStream->avail_out)
289 0 0 else if ((!pStream->avail_in) && (flush != MZ_FINISH))
0 0 else if ((!pStream->avail_in) && (flush != MZ_FINISH))
291 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))
302 0 73890 if (!pStream)
304 73890 0 if (pStream->state)
326 0 73890 if ((mz_uint64)(source_len | *pDest_len) > 0xFFFFFFFFU)
335 0 73890 if (status != MZ_OK)
339 0 73890 if (status != MZ_STREAM_END)
342 0 0 return (status == MZ_OK) ? MZ_BUF_ERROR : status;
375 0 0 if (!pStream)
377 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))
386 0 0 if (!pStream->zalloc)
388 0 0 if (!pStream->zfree)
392 0 0 if (!pDecomp)
416 0 0 if (!pStream)
446 0 0 if ((!pStream) || (!pStream->state))
0 0 if ((!pStream) || (!pStream->state))
448 0 0 if (flush == MZ_PARTIAL_FLUSH)
450 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))
454 0 0 if (pState->m_window_bits > 0)
460 0 0 if (pState->m_last_status < 0)
463 0 0 if (pState->m_has_flushed && (flush != MZ_FINISH))
0 0 if (pState->m_has_flushed && (flush != MZ_FINISH))
467 0 0 if ((flush == MZ_FINISH) && (first_call))
0 0 if ((flush == MZ_FINISH) && (first_call))
483 0 0 if (status < 0)
485 0 0 else if (status != TINFL_STATUS_DONE)
493 0 0 if (flush != MZ_FINISH)
496 0 0 if (pState->m_dict_avail)
505 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;
531 0 0 if (status < 0)
533 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))
535 0 0 else if (flush == MZ_FINISH)
538 0 0 if (status == TINFL_STATUS_DONE)
539 0 0 return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
541 0 0 else if (!pStream->avail_out)
544 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))
548 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;
553 0 0 if (!pStream)
555 0 0 if (pStream->state)
569 0 0 if ((mz_uint64)(*pSource_len | *pDest_len) > 0xFFFFFFFFU)
578 0 0 if (status != MZ_OK)
583 0 0 if (status != MZ_STREAM_END)
586 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;
611 0 0 for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i)
612 0 0 if (s_error_descs[i].m_err == err)
758 609481 86616 for (i = 0; i < num_syms; i++)
764 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]))
766 92088 86616 for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8)
770 23574528 92088 for (i = 0; i < 256; i++)
775 657313 92088 for (i = 0; i < num_syms; i++)
790 0 86616 if (n == 0)
792 19620 66996 else if (n == 1)
800 455869 66996 for (next = 1; next < n - 1; next++)
802 412424 43445 if (leaf >= n || A[root].m_key < A[leaf].m_key)
179574 232850 if (leaf >= n || A[root].m_key < A[leaf].m_key)
809 392014 63855 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
360686 31328 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
168995 191691 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
818 455869 66996 for (next = n - 3; next >= 0; next--)
824 331948 66996 while (avbl > 0)
826 720821 133992 while (root >= 0 && (int)A[root].m_key == dpth)
522865 197956 while (root >= 0 && (int)A[root].m_key == dpth)
831 589861 331948 while (avbl > used)
851 19620 66996 if (code_list_len <= 1)
853 1369908 66996 for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++)
855 773964 66996 for (i = max_code_size; i > 0; i--)
857 0 66996 while (total != (1UL << max_code_size))
860 0 0 for (i = max_code_size - 1; i > 0; i--)
861 0 0 if (pNum_codes[i])
876 90036 86616 if (static_table)
878 14405760 90036 for (i = 0; i < table_len; i++)
886 9787608 86616 for (i = 0; i < table_len; i++)
887 609481 9178127 if (pSym_count[i])
896 609481 86616 for (i = 0; i < num_used_syms; i++)
903 1068264 86616 for (i = 1, j = num_used_syms; i <= code_size_limit; i++)
904 609481 1068264 for (l = num_codes[i]; l > 0; l--)
909 2242152 176652 for (j = 0, i = 2; i <= code_size_limit; i++)
912 24193368 176652 for (i = 0; i < table_len; i++)
915 9178127 15015241 if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0)
918 117208761 15015241 for (l = code_size; l > 0; l--, code >>= 1)
1001 86296 0 for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--)
1002 28872 57424 if (d->m_huff_code_sizes[0][num_lit_codes - 1])
1004 664128 4536 for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--)
1005 24336 639792 if (d->m_huff_code_sizes[1][num_dist_codes - 1])
1016 8426336 28872 for (i = 0; i < total_code_sizes_to_pack; i++)
1019 7993922 432414 if (!code_size)
1021 33827 7960095 TDEFL_RLE_PREV_CODE_SIZE();
30840 2987 TDEFL_RLE_PREV_CODE_SIZE();
37145 30840 TDEFL_RLE_PREV_CODE_SIZE();
1022 3780 7990142 if (++rle_z_count == 138)
1024 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();
1029 326494 105920 TDEFL_RLE_ZERO_CODE_SIZE();
90223 236271 TDEFL_RLE_ZERO_CODE_SIZE();
128326 90223 TDEFL_RLE_ZERO_CODE_SIZE();
64407 171864 TDEFL_RLE_ZERO_CODE_SIZE();
1030 369625 62789 if (code_size != prev_code_size)
1032 9491 360134 TDEFL_RLE_PREV_CODE_SIZE();
9154 337 TDEFL_RLE_PREV_CODE_SIZE();
11367 9154 TDEFL_RLE_PREV_CODE_SIZE();
1036 0 62789 else if (++rle_repeat_count == 6)
1038 0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
1043 3569 25303 if (rle_repeat_count)
1045 3569 0 TDEFL_RLE_PREV_CODE_SIZE();
3488 81 TDEFL_RLE_PREV_CODE_SIZE();
3630 3488 TDEFL_RLE_PREV_CODE_SIZE();
1049 0 25303 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();
1054 0 0 TDEFL_PUT_BITS(2, 2);
0 28872 TDEFL_PUT_BITS(2, 2);
1056 28872 0 TDEFL_PUT_BITS(num_lit_codes - 257, 5);
28872 28872 TDEFL_PUT_BITS(num_lit_codes - 257, 5);
1057 0 0 TDEFL_PUT_BITS(num_dist_codes - 1, 5);
0 28872 TDEFL_PUT_BITS(num_dist_codes - 1, 5);
1059 60510 0 for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--)
1060 28872 31638 if (d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]])
1063 28872 0 TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
28872 28872 TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
1064 516930 28872 for (i = 0; (int)i < num_bit_lengths; i++)
1065 173221 0 TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
173221 516930 TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
1067 793549 28872 for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes;)
1071 253894 0 TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
253894 793549 TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
1072 243456 550093 if (code >= 16)
1073 178628 0 TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
178628 243456 TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
1082 6482592 45018 for (i = 0; i <= 143; ++i)
1084 5042016 45018 for (; i <= 255; ++i)
1086 1080432 45018 for (; i <= 279; ++i)
1088 360144 45018 for (; i <= 287; ++i)
1096 0 0 TDEFL_PUT_BITS(1, 2);
0 45018 TDEFL_PUT_BITS(1, 2);
1203 4919745 73890 for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf; flags >>= 1)
1205 644122 4275623 if (flags == 1)
1207 4165354 754391 if (flags & 1)
1214 550630 0 TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
550630 4165354 TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
1215 29760 0 TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]);
29760 4165354 TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]);
1217 4147498 17856 if (match_dist < 512)
1228 540546 0 TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
540546 4165354 TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
1229 356473 0 TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
356473 4165354 TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
1235 589875 0 TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
589875 754391 TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
1239 56227 0 TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
56227 73890 TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
1247 45018 28872 if (static_block)
1261 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;
1262 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;
1274 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))
1281 517230 0 for (i = 0; i < mz_un; i++)
1282 73890 443340 if (s_tdefl_num_probes[i] == (d->m_flags & 0xFFF)) break;
1284 0 73890 if (i < 2)
1286 0 73890 else if (i < 6)
1288 73890 0 else if (i == 6)
1295 73890 0 TDEFL_PUT_BITS(cmf, 8);
73890 73890 TDEFL_PUT_BITS(cmf, 8);
1296 73890 0 TDEFL_PUT_BITS(flg, 8);
73890 73890 TDEFL_PUT_BITS(flg, 8);
1299 0 0 TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
0 73890 TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
1305 73890 0 if (!use_raw_block)
1306 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));
1309 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))) &&
37776 36114 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
37776 0 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
1315 0 0 TDEFL_PUT_BITS(0, 2);
0 37776 TDEFL_PUT_BITS(0, 2);
1316 37776 0 if (d->m_bits_in)
1318 37776 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
37776 37776 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1320 75552 37776 for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF)
1322 151104 0 TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
151104 75552 TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
1324 334378 37776 for (i = 0; i < d->m_total_lz_bytes; ++i)
1326 334378 0 TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
334378 334378 TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
1330 0 36114 else if (!comp_block_succeeded)
1337 73890 0 if (flush)
1339 73890 0 if (flush == TDEFL_FINISH)
1341 31313 42577 if (d->m_bits_in)
1343 31313 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
31313 31313 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1345 73890 0 if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER)
1348 295560 73890 for (i = 0; i < 4; i++)
1350 295560 0 TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
295560 295560 TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
1358 0 0 TDEFL_PUT_BITS(0, 3);
0 0 TDEFL_PUT_BITS(0, 3);
1359 0 0 if (d->m_bits_in)
1361 0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1363 0 0 for (i = 2; i; --i, z ^= 0xFFFF)
1365 0 0 TDEFL_PUT_BITS(z & 0xFFFF, 16);
0 0 TDEFL_PUT_BITS(z & 0xFFFF, 16);
1382 73890 0 if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0)
1384 0 73890 if (d->m_pPut_buf_func)
1387 0 0 if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user))
1390 71154 2736 else if (pOutput_buf_start == d->m_output_buf)
1392 0 71154 int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs));
1395 0 71154 if ((n -= bytes_to_copy) != 0)
1488 4826486 93259 if (max_match_len <= match_len)
1494 6281553 32880 if (--num_probes_left == 0)
1503 5621857 659696 TDEFL_PROBE;
5600617 21240 TDEFL_PROBE;
4399989 1200628 TDEFL_PROBE;
132 4399857 TDEFL_PROBE;
1504 1192583 8177 TDEFL_PROBE;
1192511 72 TDEFL_PROBE;
241 1192270 TDEFL_PROBE;
0 241 TDEFL_PROBE;
1505 1192116 154 TDEFL_PROBE;
1192116 0 TDEFL_PROBE;
1191972 144 TDEFL_PROBE;
0 144 TDEFL_PROBE;
1507 4400242 0 if (!dist)
1511 1078645112 4104267 for (probe_len = 0; probe_len < max_match_len; probe_len++)
1512 1078349137 295975 if (*p++ != *q++)
1514 4395202 5040 if (probe_len > match_len)
1517 290935 4104267 if ((*pMatch_len = match_len = probe_len) == max_match_len)
1716 0 0 if (--d->m_num_flags_left == 0)
58965 695426 if (--d->m_num_flags_left == 0)
1740 0 0 if (--d->m_num_flags_left == 0)
0 0 if (--d->m_num_flags_left == 0)
519035 3646319 if (--d->m_num_flags_left == 0)
1748 0 0 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
0 0 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
4147498 17856 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
1758 4426050 567585 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
567585 0 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
493695 73890 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
1762 4845855 73890 if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1))
1766 519471 4326384 mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size);
1767 4845855 0 const mz_uint8 *pSrc_end = pSrc ? pSrc + num_bytes_to_process : NULL;
1770 1054125864 4845855 while (pSrc != pSrc_end)
1774 5322552 1048803312 if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
1785 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))
1791 7396656 25920 if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
1793 7275168 147408 if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN)
1803 0 4919745 if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
0 0 if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
1809 0 4919745 cur_match_len = d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1);
1811 0 4919745 if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS))
1813 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)))
1817 0 0 while (cur_match_len < d->m_lookahead_size)
1819 0 0 if (d->m_dict[cur_pos + cur_match_len] != c)
1823 0 0 if (cur_match_len < TDEFL_MIN_MATCH_LEN)
1833 8470 4911275 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)))
8470 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)))
4845735 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 4845735 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)))
1837 0 4919745 if (d->m_saved_match_len)
1839 0 0 if (cur_match_len > d->m_saved_match_len)
1842 0 0 if (cur_match_len >= 128)
1862 754391 4165354 else if (!cur_match_dist)
1863 754391 0 tdefl_record_literal(d, d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]);
1864 0 4165354 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))
1871 0 0 d->m_saved_lit = d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)];
1881 4919745 0 if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) ||
2281608 2638137 if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) ||
1882 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))))
1887 0 0 if ((n = tdefl_flush_block(d, 0)) != 0)
1899 73890 0 if (d->m_pIn_buf_size)
1904 73890 0 if (d->m_pOut_buf_size)
1915 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;
1920 0 73890 if (!d)
1922 0 0 if (pIn_buf_size)
1924 0 0 if (pOut_buf_size)
1934 73890 0 d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0;
1938 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) ||
1939 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))
1941 0 0 if (pIn_buf_size)
1943 0 0 if (pOut_buf_size)
1949 73890 0 if ((d->m_output_flush_remaining) || (d->m_finished))
0 73890 if ((d->m_output_flush_remaining) || (d->m_finished))
1963 0 73890 if (!tdefl_compress_normal(d))
1967 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))
1970 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))
1972 0 73890 if (tdefl_flush_block(d, flush) < 0)
1975 0 73890 if (flush == TDEFL_FULL_FLUSH)
2000 73890 0 if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
2021 73890 0 if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
2042 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))
2045 0 0 if (!pComp)
2048 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);
2064 0 0 if (new_size > p->m_capacity)
2068 0 0 if (!p->m_expandable)
2073 0 0 } while (new_size > new_capacity);
2075 0 0 if (!pNew_buf)
2089 0 0 if (!pOut_len)
2094 0 0 if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
2104 0 0 if (!pOut_buf)
2108 0 0 if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
2118 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);
2119 73890 0 if (window_bits > 0)
2122 0 73890 if (!level)
2124 0 73890 else if (strategy == MZ_FILTERED)
2126 0 73890 else if (strategy == MZ_HUFFMAN_ONLY)
2128 0 73890 else if (strategy == MZ_FIXED)
2130 0 73890 else if (strategy == MZ_RLE)
2153 0 0 if (!pComp)
2158 0 0 if (NULL == (out_buf.m_pBuf = (mz_uint8 *)MZ_MALLOC(out_buf.m_capacity)))
2164 0 0 for (z = 41; z; --z)
2168 0 0 for (y = 0; y < h; ++y)
2171 0 0 tdefl_compress_buffer(pComp, (mz_uint8 *)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH);
2173 0 0 if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE)
2202 0 0 for (i = 0; i < 4; ++i, c <<= 8)
2207 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))
2215 0 0 for (i = 0; i < 4; ++i, c <<= 8)
2429 0 0 if (r->m_type == 0)
2431 0 0 else if (r->m_type == 1)
2453 0 0 mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next ? pOut_buf_next + *pOut_buf_size : NULL;
2454 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;
2457 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))
2480 0 0 if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
2482 0 0 TINFL_GET_BYTE(1, r->m_zhdr0);
0 0 TINFL_GET_BYTE(1, r->m_zhdr0);
2483 0 0 TINFL_GET_BYTE(2, r->m_zhdr1);
0 0 TINFL_GET_BYTE(2, r->m_zhdr1);
2484 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));
2485 0 0 if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
2486 0 0 counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)((size_t)1 << (8U + (r->m_zhdr0 >> 4)))));
0 0 counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)((size_t)1 << (8U + (r->m_zhdr0 >> 4)))));
2487 0 0 if (counter)
2495 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);
2497 0 0 if (r->m_type == 0)
2499 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);
2500 0 0 for (counter = 0; counter < 4; ++counter)
2502 0 0 if (num_bits)
2503 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);
2505 0 0 TINFL_GET_BYTE(7, r->m_raw_header[counter]);
0 0 TINFL_GET_BYTE(7, r->m_raw_header[counter]);
2507 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))))
2511 0 0 while ((counter) && (num_bits))
0 0 while ((counter) && (num_bits))
2513 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);
2514 0 0 while (pOut_buf_cur >= pOut_buf_end)
2521 0 0 while (counter)
2524 0 0 while (pOut_buf_cur >= pOut_buf_end)
2528 0 0 while (pIn_buf_cur >= pIn_buf_end)
2530 0 0 TINFL_CR_RETURN(38, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS);
2539 0 0 else if (r->m_type == 3)
2545 0 0 if (r->m_type == 1)
2552 0 0 for (i = 0; i <= 143; ++i)
2554 0 0 for (; i <= 255; ++i)
2556 0 0 for (; i <= 279; ++i)
2558 0 0 for (; i <= 287; ++i)
2563 0 0 for (counter = 0; counter < 3; counter++)
2565 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]);
2569 0 0 for (counter = 0; counter < r->m_table_sizes[2]; counter++)
2572 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);
2577 0 0 for (; (int)r->m_type >= 0; r->m_type--)
2590 0 0 for (i = 0; i < r->m_table_sizes[r->m_type]; ++i)
2594 0 0 for (i = 1; i <= 15; ++i)
2599 0 0 if ((65536 != total) && (used_syms > 1))
0 0 if ((65536 != total) && (used_syms > 1))
2603 0 0 for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index)
2606 0 0 if (!code_size)
2609 0 0 for (l = code_size; l > 0; l--, cur_code >>= 1)
2611 0 0 if (code_size <= TINFL_FAST_LOOKUP_BITS)
2614 0 0 while (rev_code < TINFL_FAST_LOOKUP_SIZE)
2621 0 0 if (0 == (tree_cur = pLookUp[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)]))
2628 0 0 for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--)
2631 0 0 if (!pTree[-tree_cur - 1])
2643 0 0 if (r->m_type == 2)
2645 0 0 for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]);)
2648 0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
0 0 TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2);
2649 0 0 if (dist < 16)
2654 0 0 if ((dist == 16) && (!counter))
0 0 if ((dist == 16) && (!counter))
2659 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);
2661 0 0 TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s);
2664 0 0 if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter)
2677 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))
2679 0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
0 0 TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0);
2680 0 0 if (counter >= 256)
2682 0 0 while (pOut_buf_cur >= pOut_buf_end)
2693 0 0 if (num_bits < 30)
2707 0 0 if ((sym2 = r->m_look_up[0][bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
2715 0 0 } while (sym2 < 0);
2720 0 0 if (counter & 256)
2731 0 0 if ((sym2 = r->m_look_up[0][bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
2739 0 0 } while (sym2 < 0);
2745 0 0 if (sym2 & 256)
2755 0 0 if ((counter &= 511) == 256)
2760 0 0 if (num_extra)
2763 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);
2767 0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
0 0 TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1);
2770 0 0 if (num_extra)
2773 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);
2778 0 0 if ((dist == 0 || dist > dist_from_out_buf_start || dist_from_out_buf_start == 0) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
0 0 if ((dist == 0 || dist > dist_from_out_buf_start || dist_from_out_buf_start == 0) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
0 0 if ((dist == 0 || dist > dist_from_out_buf_start || dist_from_out_buf_start == 0) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
0 0 if ((dist == 0 || dist > dist_from_out_buf_start || dist_from_out_buf_start == 0) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
2785 0 0 if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end)
2787 0 0 while (counter--)
2789 0 0 while (pOut_buf_cur >= pOut_buf_end)
2824 0 0 while(counter>2)
2833 0 0 if (counter > 0)
2836 0 0 if (counter > 1)
2842 0 0 } while (!(r->m_final & 1));
2846 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);
2847 0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
2855 0 0 if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
2857 0 0 for (counter = 0; counter < 4; ++counter)
2860 0 0 if (num_bits)
2861 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);
2863 0 0 TINFL_GET_BYTE(42, s);
0 0 TINFL_GET_BYTE(42, s);
2875 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))
2877 0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
2891 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))
2897 0 0 while (buf_len)
2899 0 0 for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
2910 0 0 for (; i < block_len; ++i)
2917 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))
2934 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,
2936 0 0 if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
0 0 if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
2944 0 0 if (status == TINFL_STATUS_DONE)
2947 0 0 if (new_out_buf_capacity < 128)
2950 0 0 if (!pNew_buf)
2968 0 0 return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len;
2977 0 0 if (!pDict)
2987 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)))
2989 0 0 if (status != TINFL_STATUS_HAS_MORE_OUTPUT)
3005 0 0 if (pDecomp)
3361 0 0 if (pArray->m_capacity >= min_new_capacity)
3363 0 0 if (growing)
3365 0 0 new_capacity = MZ_MAX(1, pArray->m_capacity);
3366 0 0 while (new_capacity < min_new_capacity)
3369 0 0 if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p, pArray->m_element_size, new_capacity)))
3378 0 0 if (new_capacity > pArray->m_capacity)
0 0 if (new_capacity > pArray->m_capacity)
0 0 if (new_capacity > pArray->m_capacity)
3380 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))
3388 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)
3390 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))
3405 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))
3407 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)
3480 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)
3488 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))
3491 0 0 if (!pZip->m_pAlloc)
3493 0 0 if (!pZip->m_pFree)
3495 0 0 if (!pZip->m_pRealloc)
3503 0 0 if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
3527 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);
3528 0 0 while (pL < pE)
0 0 while (pL < pE)
0 0 while (pL < pE)
0 0 while (pL < pE)
3530 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)))
3535 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);
3557 0 0 if (size <= 1U)
3568 0 0 if ((child = (root << 1U) + 1U) >= size)
3570 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])));
3571 0 0 if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
3576 0 0 if (!start)
3582 0 0 while (end > 0)
3588 0 0 if ((child = (root << 1U) + 1U) >= end)
3590 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]));
3591 0 0 if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
3607 0 0 if (pZip->m_archive_size < record_size)
3614 0 0 int i, n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs);
3616 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n)
3619 0 0 for (i = n - 4; i >= 0; --i)
3622 0 0 if (s == record_sig)
3624 0 0 if ((pZip->m_archive_size - (cur_file_ofs + i)) >= record_size)
3629 0 0 if (i >= 0)
3636 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)))
3639 0 0 cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0);
3665 0 0 if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
3668 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))
3672 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)
3675 0 0 if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG)
3678 0 0 if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
3680 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)
3682 0 0 if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG)
3685 0 0 if (zip64_end_of_central_dir_ofs > (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
3688 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)
3690 0 0 if (MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG)
3706 0 0 if (pZip->m_pState->m_zip64)
3714 0 0 if (zip64_size_of_end_of_central_dir_record < (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12))
3717 0 0 if (zip64_total_num_of_disks != 1U)
3721 0 0 if (zip64_cdir_total_entries > MZ_UINT32_MAX)
3726 0 0 if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX)
3732 0 0 if (zip64_size_of_central_directory > MZ_UINT32_MAX)
3744 0 0 if (pZip->m_total_files != cdir_entries_on_this_disk)
3747 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)))
3750 0 0 if (cdir_size < (mz_uint64)pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
3753 0 0 if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size)
3758 0 0 if (pZip->m_total_files)
3762 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)) ||
3766 0 0 if (sort_central_dir)
3768 0 0 if (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))
3772 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size)
3777 0 0 for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i)
3782 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))
3787 0 0 if (sort_central_dir)
3796 0 0 if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
0 0 if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
3797 0 0 (ext_data_size) &&
3803 0 0 if (extra_size_remaining)
3808 0 0 if (MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + ext_data_size > n)
3811 0 0 if(buf==NULL)
3814 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)
3832 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
3841 0 0 if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
3847 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
3857 0 0 } while (extra_size_remaining);
3864 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))
3866 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))
3871 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)))
3874 0 0 if (comp_size != MZ_UINT32_MAX)
3876 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)
3881 0 0 if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED)
3884 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)
3892 0 0 if (sort_central_dir)
3900 0 0 if (pZip)
3908 0 0 if (!pZip)
3911 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))
3913 0 0 if (set_last_error)
3919 0 0 if (pZip->m_pState)
3957 0 0 if ((!pZip) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pRead))
3960 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
3966 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
3978 0 0 size_t s = (file_ofs >= pZip->m_archive_size) ? 0 : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n);
3985 0 0 if (!pMem)
3988 0 0 if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
3991 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
4008 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
4134 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))
4143 0 0 if (!p)
4159 0 0 if (!p)
4168 0 0 if ((method != 0) && (method != MZ_DEFLATED))
0 0 if ((method != 0) && (method != MZ_DEFLATED))
4174 0 0 if (bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION))
4180 0 0 if (bit_flag & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG)
4193 0 0 if (!p)
4200 0 0 if (filename_len)
4202 0 0 if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/')
4213 0 0 if ((external_attr & MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG) != 0)
4226 0 0 if (pFound_zip64_extra_data)
4229 0 0 if ((!p) || (!pStat))
0 0 if ((!p) || (!pStat))
4268 0 0 if (MZ_MAX(MZ_MAX(pStat->m_comp_size, pStat->m_uncomp_size), pStat->m_local_header_ofs) == MZ_UINT32_MAX)
4273 0 0 if (extra_size_remaining)
4282 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
4288 0 0 if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
4291 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
4296 0 0 if (pFound_zip64_extra_data)
4299 0 0 if (pStat->m_uncomp_size == MZ_UINT32_MAX)
4301 0 0 if (field_data_remaining < sizeof(mz_uint64))
4309 0 0 if (pStat->m_comp_size == MZ_UINT32_MAX)
4311 0 0 if (field_data_remaining < sizeof(mz_uint64))
4319 0 0 if (pStat->m_local_header_ofs == MZ_UINT32_MAX)
4321 0 0 if (field_data_remaining < sizeof(mz_uint64))
4334 0 0 } while (extra_size_remaining);
4344 0 0 if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE)
0 0 if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE)
4346 0 0 for (i = 0; i < len; ++i)
0 0 for (i = 0; i < len; ++i)
4347 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]))
4358 0 0 pE = pL + MZ_MIN(l_len, r_len);
4359 0 0 while (pL < pE)
4361 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)))
4366 0 0 return (pL == pE) ? (int)(l_len - r_len) : (l - r);
4378 0 0 if (pIndex)
4381 0 0 if (size)
4387 0 0 while (l <= h)
4393 0 0 if (!comp)
4395 0 0 if (pIndex)
4399 0 0 else if (comp < 0)
4412 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pName, pComment, flags, &index))
4423 0 0 if (pIndex)
4426 0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
4430 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) &&
4431 0 0 (pZip->m_zip_mode == MZ_ZIP_MODE_READING) &&
4432 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))
4439 0 0 if (name_len > MZ_UINT16_MAX)
4442 0 0 comment_len = pComment ? strlen(pComment) : 0;
4443 0 0 if (comment_len > MZ_UINT16_MAX)
4446 0 0 for (file_index = 0; file_index < pZip->m_total_files; file_index++)
4451 0 0 if (filename_len < name_len)
4453 0 0 if (comment_len)
4457 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)))
4460 0 0 if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len))
0 0 if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len))
4465 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] == ':'))
4467 0 0 } while (--ofs >= 0);
4472 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)))
4474 0 0 if (pIndex)
4494 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))
4497 0 0 if (st) {
4500 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4504 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))
4508 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))
4512 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))
4516 0 0 needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size;
4517 0 0 if (buf_size < needed_size)
4522 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)
4525 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4529 0 0 if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
4532 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))
4535 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, (size_t)needed_size) != needed_size)
4539 0 0 if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) == 0)
4541 0 0 if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
4552 0 0 if (pZip->m_pState->m_pMem)
4559 0 0 else if (pUser_read_buf)
4562 0 0 if (!user_read_buf_size)
4576 0 0 if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
4587 0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
4590 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4601 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));
4605 0 0 } while (status == TINFL_STATUS_NEEDS_MORE_INPUT);
4607 0 0 if (status == TINFL_STATUS_DONE)
4610 0 0 if (out_buf_ofs != file_stat.m_uncomp_size)
4616 0 0 else if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
4624 0 0 if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
0 0 if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
4638 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4659 0 0 if (pSize)
4662 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4665 0 0 alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size;
4672 0 0 if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size)))
4678 0 0 if (!mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf, (size_t)alloc_size, flags, NULL, 0, &file_stat))
4684 0 0 if (pSize)
4692 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4694 0 0 if (pSize)
4714 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))
4717 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4721 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))
4725 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))
4729 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))
4734 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)
4737 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4741 0 0 if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
4745 0 0 if (pZip->m_pState->m_pMem)
4754 0 0 if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
4761 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))
4764 0 0 if (pZip->m_pState->m_pMem)
4769 0 0 if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size)
4774 0 0 else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
4787 0 0 while (comp_remaining)
4790 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4798 0 0 if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
4804 0 0 if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4822 0 0 if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
4833 0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
4836 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4848 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);
4852 0 0 if (out_buf_size)
4854 0 0 if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size)
4864 0 0 if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size)
4871 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));
4875 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)))
4878 0 0 if (out_buf_ofs != file_stat.m_uncomp_size)
4884 0 0 else if (file_crc32 != file_stat.m_crc32)
4892 0 0 if (!pZip->m_pState->m_pMem)
4895 0 0 if (pWrite_buf)
4904 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4917 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
4922 0 0 if (!pState)
4929 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &pState->file_stat))
4936 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))
4944 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))
4968 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)
4975 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4983 0 0 if ((pState->cur_file_ofs + pState->file_stat.m_comp_size) > pZip->m_archive_size)
4991 0 0 if (pZip->m_pState->m_pMem)
4999 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)))
5003 0 0 if (NULL == (pState->pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)pState->read_buf_size)))
5019 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)))
5025 0 0 if (NULL == (pState->pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
5028 0 0 if (pState->pRead_buf)
5043 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
5055 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))
5058 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))
5064 0 0 if (pState->pZip->m_pState->m_pMem)
5073 0 0 if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pvBuf, copied_to_caller) != copied_to_caller)
5084 0 0 if (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
5103 0 0 if (!pState->out_blk_remain)
5106 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))
5110 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)
5125 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);
5133 0 0 if (pState->out_blk_remain)
5150 0 0 if ((pState->out_buf_ofs += to_copy) > pState->file_stat.m_uncomp_size)
5160 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)) );
5172 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))
5176 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)))
5179 0 0 if (pState->out_buf_ofs != pState->file_stat.m_uncomp_size)
5185 0 0 else if (pState->file_crc32 != pState->file_stat.m_crc32)
5194 0 0 if (!pState->pZip->m_pState->m_pMem)
5196 0 0 if (pState->pWrite_buf)
5309 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))
5312 0 0 if (file_index > pZip->m_total_files)
5319 0 0 if (!mz_zip_file_stat_internal(pZip, file_index, pCentral_dir_header, &file_stat, &found_zip64_ext_data_in_cdir))
5323 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))
5327 0 0 if (file_stat.m_is_encrypted)
5331 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))
5334 0 0 if (!file_stat.m_is_supported)
5339 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)
5342 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
5353 0 0 if (local_header_filename_len != strlen(file_stat.m_filename))
5356 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)
5359 0 0 if (!mz_zip_array_resize(pZip, &file_data_array, MZ_MAX(local_header_filename_len, local_header_extra_len), MZ_FALSE))
5365 0 0 if (local_header_filename_len)
5367 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)
5374 0 0 if (memcmp(file_stat.m_filename, file_data_array.m_p, local_header_filename_len) != 0)
5381 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)))
5386 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)
5396 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
5406 0 0 if (field_total_size > extra_size_remaining)
5412 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
5416 0 0 if (field_data_size < sizeof(mz_uint64) * 2)
5431 0 0 } while (extra_size_remaining);
5436 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))
5444 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;
5446 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))
5453 0 0 pSrc = has_id ? (descriptor_buf + sizeof(mz_uint32)) : descriptor_buf;
5457 0 0 if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
0 0 if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
5468 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))
5476 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))
5485 0 0 if ((flags & MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY) == 0)
5487 0 0 if (!mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_compute_crc32_callback, &uncomp_crc32, 0))
5491 0 0 if (uncomp_crc32 != file_stat.m_crc32)
5510 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))
5516 0 0 if (!pState->m_zip64)
5518 0 0 if (pZip->m_total_files > MZ_UINT16_MAX)
5521 0 0 if (pZip->m_archive_size > MZ_UINT32_MAX)
5526 0 0 if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
5530 0 0 for (i = 0; i < pZip->m_total_files; i++)
5532 0 0 if (MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG & flags)
5537 0 0 if (!mz_zip_reader_file_stat(pZip, i, &stat))
5540 0 0 if (!mz_zip_reader_locate_file_v2(pZip, stat.m_filename, NULL, 0, &found_index))
5544 0 0 if (found_index != i)
5548 0 0 if (!mz_zip_validate_file(pZip, i, flags))
5561 0 0 if ((!pMem) || (!size))
0 0 if ((!pMem) || (!size))
5563 0 0 if (pErr)
5570 0 0 if (!mz_zip_reader_init_mem(&zip, pMem, size, flags))
5572 0 0 if (pErr)
5577 0 0 if (!mz_zip_validate_archive(&zip, flags))
5583 0 0 if (!mz_zip_reader_end_internal(&zip, success))
5585 0 0 if (!actual_err)
5590 0 0 if (pErr)
5671 0 0 if (!n)
5681 0 0 if (new_size > pState->m_mem_capacity)
5686 0 0 while (new_capacity < new_size)
5689 0 0 if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity)))
5708 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)))
5710 0 0 if (set_last_error)
5738 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))
5753 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))
5756 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5758 0 0 if (!pZip->m_pRead)
5762 0 0 if (pZip->m_file_offset_alignment)
5765 0 0 if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1))
5769 0 0 if (!pZip->m_pAlloc)
5771 0 0 if (!pZip->m_pFree)
5773 0 0 if (!pZip->m_pRealloc)
5780 0 0 if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
5808 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5813 0 0 if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
5818 0 0 if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning)))
5820 0 0 if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size)))
5930 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))
5933 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ZIP64)
5936 0 0 if (!pZip->m_pState->m_zip64)
5941 0 0 if (pZip->m_pState->m_zip64)
5943 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
5948 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
5951 0 0 if ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX)
5957 0 0 if (pState->m_pFile)
5984 0 0 else if (pState->m_pMem)
5987 0 0 if (pZip->m_pIO_opaque != pZip)
5995 0 0 else if (!pZip->m_pWrite)
6034 0 0 if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque, pState->m_cur_archive_file_ofs, pBuf, len) != len)
6053 0 0 if (pUncomp_size)
6060 0 0 if (pComp_size)
6067 0 0 if (pLocal_header_ofs)
6084 0 0 MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0);
6090 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
6091 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
6106 0 0 MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0);
6112 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
6113 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
6118 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_MIN(local_header_ofs, MZ_UINT32_MAX));
6134 0 0 if (!pZip->m_pState->m_zip64)
6136 0 0 if (local_header_ofs > 0xFFFFFFFF)
6141 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)
6144 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))
6147 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)) ||
6148 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) ||
6149 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) ||
6150 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, user_extra_data, user_extra_data_len)) ||
6151 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) ||
6165 0 0 if (*pArchive_name == '/')
6176 0 0 if (!pZip->m_file_offset_alignment)
6185 0 0 memset(buf, 0, MZ_MIN(sizeof(buf), n));
6186 0 0 while (n)
6189 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s)
6221 0 0 if ((int)level_and_flags < 0)
6224 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)))
6227 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
6231 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));
6233 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))
6238 0 0 if (pState->m_zip64)
6240 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6245 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6250 0 0 if (((mz_uint64)buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
0 0 if (((mz_uint64)buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
6257 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))
6260 0 0 if (!mz_zip_writer_validate_archive_name(pArchive_name))
6264 0 0 if (last_modified != NULL)
6276 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
6280 0 0 if (uncomp_size <= 3)
6288 0 0 if (archive_name_size > MZ_UINT16_MAX)
6294 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)
6297 0 0 if (!pState->m_zip64)
6300 0 0 if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size
6310 0 0 if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
0 0 if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
6316 0 0 if ((buf_size) || (uncomp_size))
0 0 if ((buf_size) || (uncomp_size))
6321 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)))
6324 0 0 if ((!store_data_uncompressed) && (buf_size))
0 0 if ((!store_data_uncompressed) && (buf_size))
6326 0 0 if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor))))
6330 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
6345 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))
6350 0 0 if (pState->m_zip64)
6352 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)
6355 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,
6359 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))
6362 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))
6367 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6374 0 0 if (pExtra_data != NULL)
6376 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
6384 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))
6386 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))
6389 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))
6394 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6402 0 0 if (user_extra_data_len > 0)
6404 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)
6410 0 0 if (store_data_uncompressed)
6412 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size)
6421 0 0 else if (buf_size)
6443 0 0 if (uncomp_size)
6452 0 0 if (pExtra_data == NULL)
6454 0 0 if (comp_size > MZ_UINT32_MAX)
6467 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)
6473 0 0 if (pExtra_data != NULL)
6475 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,
6479 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,
6505 0 0 if ((int)level_and_flags < 0)
6509 0 0 gen_flags = (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE) ? 0 : MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
6511 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
6515 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))
6520 0 0 if ((!pState->m_zip64) && (max_size > MZ_UINT32_MAX))
0 0 if ((!pState->m_zip64) && (max_size > MZ_UINT32_MAX))
6528 0 0 if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
6531 0 0 if (!mz_zip_writer_validate_archive_name(pArchive_name))
6534 0 0 if (pState->m_zip64)
6536 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6541 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6549 0 0 if (archive_name_size > MZ_UINT16_MAX)
6555 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)
6558 0 0 if (!pState->m_zip64)
6561 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
6571 0 0 if (pFile_time)
6577 0 0 if (max_size <= 3)
6580 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
6593 0 0 if (max_size && level)
0 0 if (max_size && level)
6599 0 0 if (pState->m_zip64)
6601 0 0 if (max_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
0 0 if (max_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
6604 0 0 if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE)
6605 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6609 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, NULL,
6614 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))
6617 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))
6622 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6629 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
6636 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))
6638 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))
6641 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))
6646 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6654 0 0 if (user_extra_data_len > 0)
6656 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)
6662 0 0 if (max_size)
6665 0 0 if (!pRead_buf)
6670 0 0 if (!level)
6675 0 0 if (n == 0)
6678 0 0 if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size))
0 0 if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size))
6683 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n)
6700 0 0 if (!pComp)
6710 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)
6723 0 0 if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size))
0 0 if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size))
6732 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))
6735 0 0 if (n == 0)
6739 0 0 if (status == TDEFL_STATUS_DONE)
6744 0 0 else if (status != TDEFL_STATUS_OKAY)
6753 0 0 if (!result)
6767 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE))
6774 0 0 if (pExtra_data == NULL)
6776 0 0 if (comp_size > MZ_UINT32_MAX)
6789 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)
6795 0 0 if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE)
6797 0 0 if (pExtra_data != NULL)
6799 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6803 0 0 if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header,
0 0 if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header,
0 0 if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header,
6812 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
6815 0 0 if (pExtra_data != NULL)
6819 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6826 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, extra_data, extra_size) != extra_size)
6833 0 0 if (pExtra_data != NULL)
6835 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,
6839 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,
6905 0 0 if (!mz_zip_array_reserve(pZip, pNew_ext, ext_len + 64, MZ_FALSE))
6910 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))
6918 0 0 if (pUncomp_size)
6924 0 0 if (pComp_size)
6930 0 0 if (pLocal_header_ofs)
6936 0 0 if (pDisk_start)
6944 0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, new_ext_block, pDst - new_ext_block))
6948 0 0 if ((pExt) && (ext_len))
0 0 if ((pExt) && (ext_len))
6957 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
6964 0 0 if (field_total_size > extra_size_remaining)
6967 0 0 if (field_id != MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
6969 0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, pExtra_data, field_total_size))
6975 0 0 } while (extra_size_remaining);
7001 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))
7007 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))
7011 0 0 if (NULL == (pSrc_central_header = mz_zip_get_cdh(pSource_zip, src_file_index)))
7014 0 0 if (MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_SIG_OFS) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)
7023 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)
7028 0 0 if (!pState->m_zip64)
7030 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
7036 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
7040 0 0 if (!mz_zip_file_stat_internal(pSource_zip, src_file_index, pSrc_central_header, &src_file_stat, NULL))
7047 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)
7050 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
7063 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)))
7070 0 0 if (!mz_zip_array_resize(pZip, &file_data_array, local_header_extra_len, MZ_FALSE))
7075 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)
7087 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
7097 0 0 if (field_total_size > extra_size_remaining)
7103 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
7107 0 0 if (field_data_size < sizeof(mz_uint64) * 2)
7122 0 0 } while (extra_size_remaining);
7127 0 0 if (!pState->m_zip64)
7134 0 0 if (approx_new_archive_size >= MZ_UINT32_MAX)
7139 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs, num_alignment_padding_bytes))
7151 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)
7157 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)))))
7160 0 0 while (src_archive_bytes_remaining)
7162 0 0 n = (mz_uint)MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining);
7163 0 0 if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, n) != n)
7170 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
7182 0 0 if (bit_flags & 8)
7185 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))
7194 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))
7200 0 0 n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == MZ_ZIP_DATA_DESCRIPTOR_ID) ? 6 : 5);
7207 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)
7215 0 0 if (pZip->m_pState->m_zip64)
7218 0 0 const mz_uint8 *pSrc_descriptor = (const mz_uint8 *)pBuf + (has_id ? sizeof(mz_uint32) : 0);
7233 0 0 n = sizeof(mz_uint32) * (has_id ? 4 : 3);
7237 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
7253 0 0 if (pState->m_zip64)
7265 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))
7273 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
7279 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))
7286 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_ext_block.m_p, new_ext_block.m_size))
7293 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))
7305 0 0 if (cur_dst_file_ofs > MZ_UINT32_MAX)
7308 0 0 if (local_dir_header_ofs >= MZ_UINT32_MAX)
7313 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
7316 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))
7324 0 0 if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
7332 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1))
7350 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))
7355 0 0 if (pState->m_zip64)
7357 0 0 if ((mz_uint64)pState->m_central_dir.m_size >= MZ_UINT32_MAX)
7362 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))
7368 0 0 if (pZip->m_total_files)
7374 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)
7380 0 0 if (pState->m_zip64)
7394 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)
7404 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)
7413 0 0 MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
7414 0 0 MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
7415 0 0 MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_size));
7416 0 0 MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_ofs));
7418 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)
7434 0 0 if ((!ppBuf) || (!pSize))
0 0 if ((!ppBuf) || (!pSize))
7440 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7443 0 0 if (pZip->m_pWrite != mz_zip_heap_write_func)
7446 0 0 if (!mz_zip_writer_finalize_archive(pZip))
7613 0 0 return pZip ? pZip->m_zip_mode : MZ_ZIP_MODE_INVALID;
7618 0 0 return pZip ? pZip->m_zip_type : MZ_ZIP_TYPE_INVALID;
7625 0 0 if (!pZip)
7636 0 0 if (!pZip)
7651 0 0 if (!pZip)
7740 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7748 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7756 0 0 return pZip ? pZip->m_total_files : 0;
7761 0 0 if (!pZip)
7768 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7775 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7782 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))
7792 0 0 if (!p)
7794 0 0 if (filename_buf_size)
7800 0 0 if (filename_buf_size)
7816 0 0 if (!pZip)
7819 0 0 if (pZip->m_zip_mode == MZ_ZIP_MODE_READING)
7822 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))