Branch Coverage

miniz.c
Criterion Covered Total %
branch 0 3416 0.0


line true false branch
45 0 0 if (!ptr)
47 0 0 while (buf_len)
49 0 0 for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
60 0 0 for (; i < block_len; ++i)
141 0 0 while (buf_len >= 4)
151 0 0 while (buf_len)
202 0 0 if (!pStream)
204 0 0 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)))
0 0 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)))
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 0 0 if (!pStream->zalloc)
215 0 0 if (!pStream->zfree)
219 0 0 if (!pComp)
224 0 0 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 0 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
0 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
0 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
0 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
0 0 if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
250 0 0 if (!pStream->avail_out)
253 0 0 if (flush == MZ_PARTIAL_FLUSH)
256 0 0 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 0 if (defl_status < 0)
282 0 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 0 if (!pStream)
304 0 0 if (pStream->state)
326 0 0 if ((mz_uint64)(source_len | *pDest_len) > 0xFFFFFFFFU)
335 0 0 if (status != MZ_OK)
339 0 0 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;
610 0 0 for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i)
611 0 0 if (s_error_descs[i].m_err == err)
752 0 0 for (i = 0; i < num_syms; i++)
758 0 0 while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256]))
0 0 while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256]))
760 0 0 for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8)
764 0 0 for (i = 0; i < 256; i++)
769 0 0 for (i = 0; i < num_syms; i++)
784 0 0 if (n == 0)
786 0 0 else if (n == 1)
794 0 0 for (next = 1; next < n - 1; next++)
796 0 0 if (leaf >= n || A[root].m_key < A[leaf].m_key)
0 0 if (leaf >= n || A[root].m_key < A[leaf].m_key)
803 0 0 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
0 0 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
0 0 if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
812 0 0 for (next = n - 3; next >= 0; next--)
818 0 0 while (avbl > 0)
820 0 0 while (root >= 0 && (int)A[root].m_key == dpth)
0 0 while (root >= 0 && (int)A[root].m_key == dpth)
825 0 0 while (avbl > used)
845 0 0 if (code_list_len <= 1)
847 0 0 for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++)
849 0 0 for (i = max_code_size; i > 0; i--)
851 0 0 while (total != (1UL << max_code_size))
854 0 0 for (i = max_code_size - 1; i > 0; i--)
855 0 0 if (pNum_codes[i])
870 0 0 if (static_table)
872 0 0 for (i = 0; i < table_len; i++)
880 0 0 for (i = 0; i < table_len; i++)
881 0 0 if (pSym_count[i])
890 0 0 for (i = 0; i < num_used_syms; i++)
897 0 0 for (i = 1, j = num_used_syms; i <= code_size_limit; i++)
898 0 0 for (l = num_codes[i]; l > 0; l--)
903 0 0 for (j = 0, i = 2; i <= code_size_limit; i++)
906 0 0 for (i = 0; i < table_len; i++)
909 0 0 if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0)
912 0 0 for (l = code_size; l > 0; l--, code >>= 1)
995 0 0 for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--)
996 0 0 if (d->m_huff_code_sizes[0][num_lit_codes - 1])
998 0 0 for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--)
999 0 0 if (d->m_huff_code_sizes[1][num_dist_codes - 1])
1010 0 0 for (i = 0; i < total_code_sizes_to_pack; i++)
1013 0 0 if (!code_size)
1015 0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
1016 0 0 if (++rle_z_count == 138)
1018 0 0 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();
1023 0 0 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();
1024 0 0 if (code_size != prev_code_size)
1026 0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
1030 0 0 else if (++rle_repeat_count == 6)
1032 0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
1037 0 0 if (rle_repeat_count)
1039 0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
0 0 TDEFL_RLE_PREV_CODE_SIZE();
1043 0 0 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();
1048 0 0 TDEFL_PUT_BITS(2, 2);
0 0 TDEFL_PUT_BITS(2, 2);
1050 0 0 TDEFL_PUT_BITS(num_lit_codes - 257, 5);
0 0 TDEFL_PUT_BITS(num_lit_codes - 257, 5);
1051 0 0 TDEFL_PUT_BITS(num_dist_codes - 1, 5);
0 0 TDEFL_PUT_BITS(num_dist_codes - 1, 5);
1053 0 0 for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--)
1054 0 0 if (d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]])
1057 0 0 TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
0 0 TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
1058 0 0 for (i = 0; (int)i < num_bit_lengths; i++)
1059 0 0 TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
0 0 TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
1061 0 0 for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes;)
1065 0 0 TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
0 0 TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
1066 0 0 if (code >= 16)
1067 0 0 TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
0 0 TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
1076 0 0 for (i = 0; i <= 143; ++i)
1078 0 0 for (; i <= 255; ++i)
1080 0 0 for (; i <= 279; ++i)
1082 0 0 for (; i <= 287; ++i)
1090 0 0 TDEFL_PUT_BITS(1, 2);
0 0 TDEFL_PUT_BITS(1, 2);
1197 0 0 for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf; flags >>= 1)
1199 0 0 if (flags == 1)
1201 0 0 if (flags & 1)
1208 0 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]]);
0 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]]);
1209 0 0 TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]);
0 0 TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]);
1211 0 0 if (match_dist < 512)
1222 0 0 TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
0 0 TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
1223 0 0 TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
0 0 TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
1229 0 0 TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
0 0 TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
1233 0 0 TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
0 0 TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
1241 0 0 if (static_block)
1255 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;
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;
1256 0 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;
0 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;
1268 0 0 if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index))
0 0 if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index))
1275 0 0 for (i = 0; i < mz_un; i++)
1276 0 0 if (s_tdefl_num_probes[i] == (d->m_flags & 0xFFF))
1279 0 0 if (i < 2)
1281 0 0 else if (i < 6)
1283 0 0 else if (i == 6)
1290 0 0 TDEFL_PUT_BITS(cmf, 8);
0 0 TDEFL_PUT_BITS(cmf, 8);
1291 0 0 TDEFL_PUT_BITS(flg, 8);
0 0 TDEFL_PUT_BITS(flg, 8);
1294 0 0 TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
0 0 TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
1300 0 0 if (!use_raw_block)
1301 0 0 comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48));
0 0 comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48));
1304 0 0 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
0 0 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
0 0 if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
1305 0 0 ((d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size))
1310 0 0 TDEFL_PUT_BITS(0, 2);
0 0 TDEFL_PUT_BITS(0, 2);
1311 0 0 if (d->m_bits_in)
1313 0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1315 0 0 for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF)
1317 0 0 TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
0 0 TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
1319 0 0 for (i = 0; i < d->m_total_lz_bytes; ++i)
1321 0 0 TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
0 0 TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
1325 0 0 else if (!comp_block_succeeded)
1332 0 0 if (flush)
1334 0 0 if (flush == TDEFL_FINISH)
1336 0 0 if (d->m_bits_in)
1338 0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1340 0 0 if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER)
1343 0 0 for (i = 0; i < 4; i++)
1345 0 0 TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
0 0 TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
1353 0 0 TDEFL_PUT_BITS(0, 3);
0 0 TDEFL_PUT_BITS(0, 3);
1354 0 0 if (d->m_bits_in)
1356 0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
0 0 TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
1358 0 0 for (i = 2; i; --i, z ^= 0xFFFF)
1360 0 0 TDEFL_PUT_BITS(z & 0xFFFF, 16);
0 0 TDEFL_PUT_BITS(z & 0xFFFF, 16);
1377 0 0 if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0)
1379 0 0 if (d->m_pPut_buf_func)
1382 0 0 if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user))
1385 0 0 else if (pOutput_buf_start == d->m_output_buf)
1387 0 0 int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs));
1390 0 0 if ((n -= bytes_to_copy) != 0)
1489 0 0 if (--num_probes_left == 0)
1498 0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
1499 0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
1500 0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
0 0 TDEFL_PROBE;
1502 0 0 if (!dist)
1506 0 0 for (probe_len = 0; probe_len < max_match_len; probe_len++)
1507 0 0 if (*p++ != *q++)
1509 0 0 if (probe_len > match_len)
1512 0 0 if ((*pMatch_len = match_len = probe_len) == max_match_len)
1743 0 0 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
0 0 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
0 0 d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
1753 0 0 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
0 0 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
0 0 while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
1757 0 0 if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1))
1761 0 0 mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size);
1762 0 0 const mz_uint8 *pSrc_end = pSrc ? pSrc + num_bytes_to_process : NULL;
1765 0 0 while (pSrc != pSrc_end)
1769 0 0 if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
1780 0 0 while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
0 0 while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
1786 0 0 if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
1788 0 0 if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN)
1798 0 0 if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
0 0 if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
1804 0 0 cur_match_len = d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1);
1806 0 0 if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS))
1808 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)))
1812 0 0 while (cur_match_len < d->m_lookahead_size)
1814 0 0 if (d->m_dict[cur_pos + cur_match_len] != c)
1818 0 0 if (cur_match_len < TDEFL_MIN_MATCH_LEN)
1826 0 0 tdefl_find_match(d, d->m_lookahead_pos, d->m_dict_size, d->m_lookahead_size, &cur_match_dist, &cur_match_len);
1828 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)))
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)))
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)))
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)))
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)))
1832 0 0 if (d->m_saved_match_len)
1834 0 0 if (cur_match_len > d->m_saved_match_len)
1836 0 0 tdefl_record_literal(d, (mz_uint8)d->m_saved_lit);
1837 0 0 if (cur_match_len >= 128)
1839 0 0 tdefl_record_match(d, cur_match_len, cur_match_dist);
1852 0 0 tdefl_record_match(d, d->m_saved_match_len, d->m_saved_match_dist);
1857 0 0 else if (!cur_match_dist)
1858 0 0 tdefl_record_literal(d, d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]);
1859 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))
0 0 else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128))
1861 0 0 tdefl_record_match(d, cur_match_len, cur_match_dist);
1876 0 0 if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) ||
1877 0 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 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 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))))
1882 0 0 if ((n = tdefl_flush_block(d, 0)) != 0)
1894 0 0 if (d->m_pIn_buf_size)
1899 0 0 if (d->m_pOut_buf_size)
1910 0 0 return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY;
0 0 return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY;
1915 0 0 if (!d)
1917 0 0 if (pIn_buf_size)
1919 0 0 if (pOut_buf_size)
1929 0 0 d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0;
1933 0 0 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) ||
0 0 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) ||
1934 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))
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))
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))
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))
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))
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))
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))
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))
1936 0 0 if (pIn_buf_size)
1938 0 0 if (pOut_buf_size)
1944 0 0 if ((d->m_output_flush_remaining) || (d->m_finished))
0 0 if ((d->m_output_flush_remaining) || (d->m_finished))
1958 0 0 if (!tdefl_compress_normal(d))
1962 0 0 if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf))
0 0 if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf))
1965 0 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
0 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
0 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
0 0 if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
1967 0 0 if (tdefl_flush_block(d, flush) < 0)
1970 0 0 if (flush == TDEFL_FULL_FLUSH)
1995 0 0 if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
2016 0 0 if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
2037 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))
2040 0 0 if (!pComp)
2043 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);
2059 0 0 if (new_size > p->m_capacity)
2063 0 0 if (!p->m_expandable)
2068 0 0 } while (new_size > new_capacity);
2070 0 0 if (!pNew_buf)
2084 0 0 if (!pOut_len)
2089 0 0 if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
2099 0 0 if (!pOut_buf)
2103 0 0 if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
2111 0 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);
0 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);
2112 0 0 if (window_bits > 0)
2115 0 0 if (!level)
2117 0 0 else if (strategy == MZ_FILTERED)
2119 0 0 else if (strategy == MZ_HUFFMAN_ONLY)
2121 0 0 else if (strategy == MZ_FIXED)
2123 0 0 else if (strategy == MZ_RLE)
2146 0 0 if (!pComp)
2151 0 0 if (NULL == (out_buf.m_pBuf = (mz_uint8 *)MZ_MALLOC(out_buf.m_capacity)))
2157 0 0 for (z = 41; z; --z)
2161 0 0 for (y = 0; y < h; ++y)
2164 0 0 tdefl_compress_buffer(pComp, (mz_uint8 *)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH);
2166 0 0 if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE)
2195 0 0 for (i = 0; i < 4; ++i, c <<= 8)
2200 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))
2208 0 0 for (i = 0; i < 4; ++i, c <<= 8)
2423 0 0 if (r->m_type == 0)
2425 0 0 else if (r->m_type == 1)
2447 0 0 mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next ? pOut_buf_next + *pOut_buf_size : NULL;
2448 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;
2451 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))
2474 0 0 if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
2476 0 0 TINFL_GET_BYTE(1, r->m_zhdr0);
0 0 TINFL_GET_BYTE(1, r->m_zhdr0);
2477 0 0 TINFL_GET_BYTE(2, r->m_zhdr1);
0 0 TINFL_GET_BYTE(2, r->m_zhdr1);
2478 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));
2479 0 0 if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
2480 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)))));
2481 0 0 if (counter)
2489 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);
2491 0 0 if (r->m_type == 0)
2493 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);
2494 0 0 for (counter = 0; counter < 4; ++counter)
2496 0 0 if (num_bits)
2497 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);
2499 0 0 TINFL_GET_BYTE(7, r->m_raw_header[counter]);
0 0 TINFL_GET_BYTE(7, r->m_raw_header[counter]);
2501 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))))
2505 0 0 while ((counter) && (num_bits))
0 0 while ((counter) && (num_bits))
2507 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);
2510 0 0 TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT);
2515 0 0 while (counter)
2520 0 0 TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT);
2524 0 0 TINFL_CR_RETURN(38, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS);
0 0 TINFL_CR_RETURN(38, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS);
2533 0 0 else if (r->m_type == 3)
2539 0 0 if (r->m_type == 1)
2546 0 0 for (i = 0; i <= 143; ++i)
2548 0 0 for (; i <= 255; ++i)
2550 0 0 for (; i <= 279; ++i)
2552 0 0 for (; i <= 287; ++i)
2557 0 0 for (counter = 0; counter < 3; counter++)
2559 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]);
2563 0 0 for (counter = 0; counter < r->m_table_sizes[2]; counter++)
2566 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);
2571 0 0 for (; (int)r->m_type >= 0; r->m_type--)
2584 0 0 for (i = 0; i < r->m_table_sizes[r->m_type]; ++i)
2588 0 0 for (i = 1; i <= 15; ++i)
2593 0 0 if ((65536 != total) && (used_syms > 1))
0 0 if ((65536 != total) && (used_syms > 1))
2597 0 0 for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index)
2600 0 0 if (!code_size)
2603 0 0 for (l = code_size; l > 0; l--, cur_code >>= 1)
2605 0 0 if (code_size <= TINFL_FAST_LOOKUP_BITS)
2608 0 0 while (rev_code < TINFL_FAST_LOOKUP_SIZE)
2615 0 0 if (0 == (tree_cur = pLookUp[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)]))
2622 0 0 for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--)
2625 0 0 if (!pTree[-tree_cur - 1])
2637 0 0 if (r->m_type == 2)
2639 0 0 for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]);)
2642 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);
2643 0 0 if (dist < 16)
2648 0 0 if ((dist == 16) && (!counter))
0 0 if ((dist == 16) && (!counter))
2653 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);
2655 0 0 TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s);
2658 0 0 if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter)
2671 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))
2673 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);
2674 0 0 if (counter >= 256)
2678 0 0 TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT);
2687 0 0 if (num_bits < 30)
2701 0 0 if ((sym2 = r->m_look_up[0][bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
2709 0 0 } while (sym2 < 0);
2714 0 0 if (counter & 256)
2725 0 0 if ((sym2 = r->m_look_up[0][bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
2733 0 0 } while (sym2 < 0);
2739 0 0 if (sym2 & 256)
2749 0 0 if ((counter &= 511) == 256)
2754 0 0 if (num_extra)
2757 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);
2761 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);
2764 0 0 if (num_extra)
2767 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);
2772 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))
2779 0 0 if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end)
2781 0 0 while (counter--)
2785 0 0 TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT);
2818 0 0 while (counter > 2)
2827 0 0 if (counter > 0)
2830 0 0 if (counter > 1)
2836 0 0 } while (!(r->m_final & 1));
2840 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);
2841 0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
2849 0 0 if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
2851 0 0 for (counter = 0; counter < 4; ++counter)
2854 0 0 if (num_bits)
2855 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);
2857 0 0 TINFL_GET_BYTE(42, s);
0 0 TINFL_GET_BYTE(42, s);
2869 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))
2871 0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
0 0 while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
2885 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))
2891 0 0 while (buf_len)
2893 0 0 for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
2904 0 0 for (; i < block_len; ++i)
2911 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))
2929 0 0 (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
2930 0 0 if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
0 0 if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
2938 0 0 if (status == TINFL_STATUS_DONE)
2941 0 0 if (new_out_buf_capacity < 128)
2944 0 0 if (!pNew_buf)
2962 0 0 return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len;
2971 0 0 if (!pDict)
2981 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)))
2983 0 0 if (status != TINFL_STATUS_HAS_MORE_OUTPUT)
2999 0 0 if (pDecomp)
3379 0 0 if (pArray->m_capacity >= min_new_capacity)
3381 0 0 if (growing)
3383 0 0 new_capacity = MZ_MAX(1, pArray->m_capacity);
3384 0 0 while (new_capacity < min_new_capacity)
3387 0 0 if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p, pArray->m_element_size, new_capacity)))
3398 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))
3406 0 0 if (new_size > pArray->m_capacity)
3408 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))
3423 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))
3425 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)
3498 0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
0 0 if (pZip)
3506 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))
3509 0 0 if (!pZip->m_pAlloc)
3511 0 0 if (!pZip->m_pFree)
3513 0 0 if (!pZip->m_pRealloc)
3521 0 0 if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
3546 0 0 while (pL < pE)
0 0 while (pL < pE)
0 0 while (pL < pE)
0 0 while (pL < pE)
3548 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)))
3553 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);
3575 0 0 if (size <= 1U)
3586 0 0 if ((child = (root << 1U) + 1U) >= size)
3588 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])));
3589 0 0 if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
3594 0 0 if (!start)
3600 0 0 while (end > 0)
3606 0 0 if ((child = (root << 1U) + 1U) >= end)
3608 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]));
3609 0 0 if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
3625 0 0 if (pZip->m_archive_size < record_size)
3632 0 0 int i, n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs);
3634 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n)
3637 0 0 for (i = n - 4; i >= 0; --i)
3640 0 0 if (s == record_sig)
3642 0 0 if ((pZip->m_archive_size - (cur_file_ofs + i)) >= record_size)
3647 0 0 if (i >= 0)
3654 0 0 if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= ((mz_uint64)(MZ_UINT16_MAX) + record_size)))
0 0 if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= ((mz_uint64)(MZ_UINT16_MAX) + record_size)))
3657 0 0 cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0);
3666 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, offset, buf, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)
3668 0 0 if (MZ_READ_LE32(buf + MZ_ZIP64_ECDH_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG)
3696 0 0 if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
3699 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))
3704 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)
3707 0 0 if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG)
3710 0 0 if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
3712 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)
3714 0 0 if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG)
3721 0 0 if (pZip->m_pState->m_zip64)
3725 0 0 if (cur_file_ofs < MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE +
3733 0 0 if (!mz_zip_reader_eocd64_valid(pZip, zip64_end_of_central_dir_ofs,
3741 0 0 (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
3744 0 0 if (!mz_zip_reader_eocd64_valid(pZip, zip64_end_of_central_dir_ofs,
3757 0 0 if (pZip->m_pState->m_zip64)
3765 0 0 if (zip64_size_of_end_of_central_dir_record < (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12))
3768 0 0 if (zip64_total_num_of_disks != 1U)
3772 0 0 if (zip64_cdir_total_entries > MZ_UINT32_MAX)
3777 0 0 if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX)
3783 0 0 if (zip64_size_of_central_directory > MZ_UINT32_MAX)
3795 0 0 if (pZip->m_total_files != cdir_entries_on_this_disk)
3798 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)))
3801 0 0 if (cdir_size < (mz_uint64)pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
3804 0 0 if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size)
3807 0 0 if (eocd_ofs < cdir_ofs + cdir_size)
3813 0 0 if (pZip->m_pState->m_zip64)
3815 0 0 if (archive_ofs < MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE +
3824 0 0 if ((pZip->m_zip_type == MZ_ZIP_TYPE_FILE || pZip->m_zip_type == MZ_ZIP_TYPE_CFILE ||
0 0 if ((pZip->m_zip_type == MZ_ZIP_TYPE_FILE || pZip->m_zip_type == MZ_ZIP_TYPE_CFILE ||
3825 0 0 pZip->m_zip_type == MZ_ZIP_TYPE_USER) && pZip->m_pState->m_file_archive_start_ofs == 0)
0 0 pZip->m_zip_type == MZ_ZIP_TYPE_USER) && pZip->m_pState->m_file_archive_start_ofs == 0)
3833 0 0 if (pZip->m_total_files)
3837 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)) ||
3838 0 0 (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, pZip->m_total_files, MZ_FALSE)))
0 0 (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, pZip->m_total_files, MZ_FALSE)))
3841 0 0 if (sort_central_dir)
3843 0 0 if (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))
0 0 if (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))
3847 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size)
3852 0 0 for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i)
3857 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))
3862 0 0 if (sort_central_dir)
3871 0 0 if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
0 0 if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
3873 0 0 (MZ_MAX(MZ_MAX(comp_size, decomp_size), local_header_ofs) == MZ_UINT32_MAX))
3878 0 0 if (extra_size_remaining)
3883 0 0 if (MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + ext_data_size > n)
3886 0 0 if (buf == NULL)
3889 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)
3891 0 0 MZ_FREE(buf);
3907 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
3909 0 0 MZ_FREE(buf);
3916 0 0 if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
3918 0 0 MZ_FREE(buf);
3922 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
3932 0 0 } while (extra_size_remaining);
3939 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))
3941 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))
3946 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)))
3949 0 0 if (comp_size != MZ_UINT32_MAX)
3951 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)
3956 0 0 if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED)
3959 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)
3967 0 0 if (sort_central_dir)
3975 0 0 if (pZip)
3983 0 0 if (!pZip)
3986 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))
3988 0 0 if (set_last_error)
3994 0 0 if (pZip->m_pState)
4032 0 0 if ((!pZip) || (!pZip->m_pRead))
0 0 if ((!pZip) || (!pZip->m_pRead))
4035 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
4041 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
4053 0 0 size_t s = (file_ofs >= pZip->m_archive_size) ? 0 : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n);
4060 0 0 if (!pMem)
4063 0 0 if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
4066 0 0 if (!mz_zip_reader_init_internal(pZip, flags))
4083 0 0 if (!mz_zip_reader_read_central_dir(pZip, flags))
4209 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))
4214 0 0 mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index)
4218 0 0 if (!p)
4228 0 0 mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index)
4234 0 0 if (!p)
4243 0 0 if ((method != 0) && (method != MZ_DEFLATED))
0 0 if ((method != 0) && (method != MZ_DEFLATED))
4249 0 0 if (bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION))
4255 0 0 if (bit_flag & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG)
4264 0 0 mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index)
4268 0 0 if (!p)
4275 0 0 if (filename_len)
4277 0 0 if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/')
4288 0 0 if ((external_attr & MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG) != 0)
4301 0 0 if (pFound_zip64_extra_data)
4304 0 0 if ((!p) || (!pStat))
0 0 if ((!p) || (!pStat))
4343 0 0 if (MZ_MAX(MZ_MAX(pStat->m_comp_size, pStat->m_uncomp_size), pStat->m_local_header_ofs) == MZ_UINT32_MAX)
4348 0 0 if (extra_size_remaining)
4357 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
4363 0 0 if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
4366 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
4371 0 0 if (pFound_zip64_extra_data)
4374 0 0 if (pStat->m_uncomp_size == MZ_UINT32_MAX)
4376 0 0 if (field_data_remaining < sizeof(mz_uint64))
4384 0 0 if (pStat->m_comp_size == MZ_UINT32_MAX)
4386 0 0 if (field_data_remaining < sizeof(mz_uint64))
4394 0 0 if (pStat->m_local_header_ofs == MZ_UINT32_MAX)
4396 0 0 if (field_data_remaining < sizeof(mz_uint64))
4409 0 0 } while (extra_size_remaining);
4419 0 0 if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE)
0 0 if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE)
4421 0 0 for (i = 0; i < len; ++i)
0 0 for (i = 0; i < len; ++i)
4422 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]))
4434 0 0 while (pL < pE)
4436 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)))
4441 0 0 return (pL == pE) ? (int)(l_len - r_len) : (l - r);
4453 0 0 if (pIndex)
4456 0 0 if (size)
4462 0 0 while (l <= h)
4468 0 0 if (!comp)
4470 0 0 if (pIndex)
4474 0 0 else if (comp < 0)
4487 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pName, pComment, flags, &index))
4498 0 0 if (pIndex)
4501 0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
0 0 if ((!pZip) || (!pZip->m_pState) || (!pName))
4505 0 0 if (((pZip->m_pState->m_init_flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0) &&
4506 0 0 (pZip->m_zip_mode == MZ_ZIP_MODE_READING) &&
4507 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))
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))
4514 0 0 if (name_len > MZ_UINT16_MAX)
4517 0 0 comment_len = pComment ? strlen(pComment) : 0;
4518 0 0 if (comment_len > MZ_UINT16_MAX)
4521 0 0 for (file_index = 0; file_index < pZip->m_total_files; file_index++)
4526 0 0 if (filename_len < name_len)
4528 0 0 if (comment_len)
4532 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)))
4535 0 0 if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len))
0 0 if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len))
4540 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] == ':'))
4542 0 0 } while (--ofs >= 0);
4547 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)))
4549 0 0 if (pIndex)
4568 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))
4571 0 0 if (st)
4575 0 0 else if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4579 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))
4583 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))
4587 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))
4591 0 0 needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size;
4592 0 0 if (buf_size < needed_size)
4597 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)
4600 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4604 0 0 if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
4607 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))
4610 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, (size_t)needed_size) != needed_size)
4614 0 0 if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) == 0)
4616 0 0 if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
4627 0 0 if (pZip->m_pState->m_pMem)
4634 0 0 else if (pUser_read_buf)
4637 0 0 if (!user_read_buf_size)
4651 0 0 if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
4662 0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
4665 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4667 0 0 status = TINFL_STATUS_FAILED;
4676 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));
4680 0 0 } while (status == TINFL_STATUS_NEEDS_MORE_INPUT);
4682 0 0 if (status == TINFL_STATUS_DONE)
4685 0 0 if (out_buf_ofs != file_stat.m_uncomp_size)
4691 0 0 else if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
4699 0 0 if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
0 0 if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
4713 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4734 0 0 if (pSize)
4737 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4740 0 0 alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size;
4747 0 0 if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size)))
4753 0 0 if (!mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf, (size_t)alloc_size, flags, NULL, 0, &file_stat))
4759 0 0 if (pSize)
4767 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4769 0 0 if (pSize)
4789 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))
4792 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
4796 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))
4800 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))
4804 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))
4809 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)
4812 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
4816 0 0 if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
4820 0 0 if (pZip->m_pState->m_pMem)
4829 0 0 if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
4836 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))
4839 0 0 if (pZip->m_pState->m_pMem)
4844 0 0 if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size)
4849 0 0 else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
4862 0 0 while (comp_remaining)
4865 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4873 0 0 if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
4879 0 0 if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4897 0 0 if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
4908 0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
0 0 if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
4911 0 0 if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
4923 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);
4927 0 0 if (out_buf_size)
4929 0 0 if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size)
4939 0 0 if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size)
4946 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));
4950 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)))
4953 0 0 if (out_buf_ofs != file_stat.m_uncomp_size)
4959 0 0 else if (file_crc32 != file_stat.m_crc32)
4967 0 0 if (!pZip->m_pState->m_pMem)
4970 0 0 if (pWrite_buf)
4979 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
4992 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
4997 0 0 if (!pState)
5004 0 0 if (!mz_zip_reader_file_stat(pZip, file_index, &pState->file_stat))
5011 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))
5019 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))
5043 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)
5050 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
5058 0 0 if ((pState->cur_file_ofs + pState->file_stat.m_comp_size) > pZip->m_archive_size)
5066 0 0 if (pZip->m_pState->m_pMem)
5074 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)))
5078 0 0 if (NULL == (pState->pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)pState->read_buf_size)))
5094 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)))
5100 0 0 if (NULL == (pState->pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
5103 0 0 if (pState->pRead_buf)
5118 0 0 if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
5130 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))
5133 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))
5139 0 0 if (pState->pZip->m_pState->m_pMem)
5148 0 0 if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pvBuf, copied_to_caller) != copied_to_caller)
5151 0 0 mz_zip_set_error(pState->pZip, MZ_ZIP_FILE_READ_FAILED);
5159 0 0 if (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
5178 0 0 if (!pState->out_blk_remain)
5181 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))
5185 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)
5187 0 0 mz_zip_set_error(pState->pZip, MZ_ZIP_FILE_READ_FAILED);
5200 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);
5208 0 0 if (pState->out_blk_remain)
5225 0 0 if ((pState->out_buf_ofs += to_copy) > pState->file_stat.m_uncomp_size)
5227 0 0 mz_zip_set_error(pState->pZip, MZ_ZIP_DECOMPRESSION_FAILED);
5235 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)));
5247 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))
5251 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)))
5254 0 0 if (pState->out_buf_ofs != pState->file_stat.m_uncomp_size)
5256 0 0 mz_zip_set_error(pState->pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE);
5260 0 0 else if (pState->file_crc32 != pState->file_stat.m_crc32)
5262 0 0 mz_zip_set_error(pState->pZip, MZ_ZIP_DECOMPRESSION_FAILED);
5269 0 0 if (!pState->pZip->m_pState->m_pMem)
5271 0 0 if (pState->pWrite_buf)
5384 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))
5387 0 0 if (file_index > pZip->m_total_files)
5390 0 0 pState = pZip->m_pState;
5394 0 0 if (!mz_zip_file_stat_internal(pZip, file_index, pCentral_dir_header, &file_stat, &found_zip64_ext_data_in_cdir))
5398 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))
5402 0 0 if (file_stat.m_is_encrypted)
5406 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))
5409 0 0 if (!file_stat.m_is_supported)
5414 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)
5417 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
5428 0 0 if (local_header_filename_len != strlen(file_stat.m_filename))
5431 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)
5434 0 0 if (!mz_zip_array_resize(pZip, &file_data_array, MZ_MAX(local_header_filename_len, local_header_extra_len), MZ_FALSE))
0 0 if (!mz_zip_array_resize(pZip, &file_data_array, MZ_MAX(local_header_filename_len, local_header_extra_len), MZ_FALSE))
5440 0 0 if (local_header_filename_len)
5442 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)
5449 0 0 if (memcmp(file_stat.m_filename, file_data_array.m_p, local_header_filename_len) != 0)
5456 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)))
5461 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)
5471 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
5481 0 0 if (field_total_size > extra_size_remaining)
5487 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
5491 0 0 if (field_data_size < sizeof(mz_uint64) * 2)
5506 0 0 } while (extra_size_remaining);
5511 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))
5519 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;
5521 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))
5528 0 0 pSrc = has_id ? (descriptor_buf + sizeof(mz_uint32)) : descriptor_buf;
5532 0 0 if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
0 0 if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
5543 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))
5551 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))
5560 0 0 if ((flags & MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY) == 0)
5562 0 0 if (!mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_compute_crc32_callback, &uncomp_crc32, 0))
5566 0 0 if (uncomp_crc32 != file_stat.m_crc32)
5585 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))
5591 0 0 if (!pState->m_zip64)
5593 0 0 if (pZip->m_total_files > MZ_UINT16_MAX)
5596 0 0 if (pZip->m_archive_size > MZ_UINT32_MAX)
5601 0 0 if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
5605 0 0 for (i = 0; i < pZip->m_total_files; i++)
5607 0 0 if (MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG & flags)
5612 0 0 if (!mz_zip_reader_file_stat(pZip, i, &stat))
5615 0 0 if (!mz_zip_reader_locate_file_v2(pZip, stat.m_filename, NULL, 0, &found_index))
5619 0 0 if (found_index != i)
5623 0 0 if (!mz_zip_validate_file(pZip, i, flags))
5636 0 0 if ((!pMem) || (!size))
0 0 if ((!pMem) || (!size))
5638 0 0 if (pErr)
5645 0 0 if (!mz_zip_reader_init_mem(&zip, pMem, size, flags))
5647 0 0 if (pErr)
5652 0 0 if (!mz_zip_validate_archive(&zip, flags))
5658 0 0 if (!mz_zip_reader_end_internal(&zip, success))
5660 0 0 if (!actual_err)
5665 0 0 if (pErr)
5746 0 0 if (!n)
5756 0 0 if (new_size > pState->m_mem_capacity)
5761 0 0 while (new_capacity < new_size)
5764 0 0 if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity)))
5783 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)))
5785 0 0 if (set_last_error)
5813 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))
5828 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))
5831 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5833 0 0 if (!pZip->m_pRead)
5837 0 0 if (pZip->m_file_offset_alignment)
5840 0 0 if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1))
5844 0 0 if (!pZip->m_pAlloc)
5846 0 0 if (!pZip->m_pFree)
5848 0 0 if (!pZip->m_pRealloc)
5855 0 0 if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
5883 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
5888 0 0 if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
5893 0 0 if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning)))
5895 0 0 if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size)))
6005 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))
6008 0 0 if (flags & MZ_ZIP_FLAG_WRITE_ZIP64)
6011 0 0 if (!pZip->m_pState->m_zip64)
6016 0 0 if (pZip->m_pState->m_zip64)
6018 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6023 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6026 0 0 if ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX)
6032 0 0 if (pState->m_pFile)
6060 0 0 else if (pState->m_pMem)
6063 0 0 if (pZip->m_pIO_opaque != pZip)
6071 0 0 else if (!pZip->m_pWrite)
6110 0 0 if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque, pState->m_cur_archive_file_ofs, pBuf, len) != len)
6129 0 0 if (pUncomp_size)
6136 0 0 if (pComp_size)
6143 0 0 if (pLocal_header_ofs)
6160 0 0 MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0);
6166 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
6167 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
6182 0 0 MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0);
6188 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
6189 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
6194 0 0 MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_MIN(local_header_ofs, MZ_UINT32_MAX));
6210 0 0 if (!pZip->m_pState->m_zip64)
6212 0 0 if (local_header_ofs > 0xFFFFFFFF)
6217 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)
6220 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))
6223 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)) ||
6224 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) ||
0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) ||
6225 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) ||
0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) ||
6226 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, user_extra_data, user_extra_data_len)) ||
0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, user_extra_data, user_extra_data_len)) ||
6227 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) ||
0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) ||
6228 0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, ¢ral_dir_ofs, 1)))
0 0 (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, ¢ral_dir_ofs, 1)))
6231 0 0 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
6241 0 0 if (*pArchive_name == '/')
6252 0 0 if (!pZip->m_file_offset_alignment)
6262 0 0 while (n)
6265 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s)
6297 0 0 if ((int)level_and_flags < 0)
6300 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)))
6303 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
6307 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));
6309 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))
6314 0 0 if (pState->m_zip64)
6316 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6321 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6326 0 0 if (((mz_uint64)buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
0 0 if (((mz_uint64)buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
6333 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))
6336 0 0 if (!mz_zip_writer_validate_archive_name(pArchive_name))
6340 0 0 if (last_modified != NULL)
6354 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
6358 0 0 if (uncomp_size <= 3)
6366 0 0 if (archive_name_size > MZ_UINT16_MAX)
6372 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)
6375 0 0 if (!pState->m_zip64)
6379 0 0 pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + user_extra_data_central_len + MZ_ZIP_DATA_DESCRIPTER_SIZE32) > 0xFFFFFFFF)
6386 0 0 if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
0 0 if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
6392 0 0 if ((buf_size) || (uncomp_size))
0 0 if ((buf_size) || (uncomp_size))
6397 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)))
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)))
6400 0 0 if ((!store_data_uncompressed) && (buf_size))
0 0 if ((!store_data_uncompressed) && (buf_size))
6402 0 0 if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor))))
6406 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
6421 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))
6426 0 0 if (pState->m_zip64)
6428 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)
6431 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6432 0 0 (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
0 0 (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
6435 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))
6438 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))
6443 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6450 0 0 if (pExtra_data != NULL)
6452 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
6460 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))
6462 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))
6465 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))
6470 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6478 0 0 if (user_extra_data_len > 0)
6480 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)
6486 0 0 if (store_data_uncompressed)
6488 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size)
6497 0 0 else if (buf_size)
6519 0 0 if (uncomp_size)
6528 0 0 if (pExtra_data == NULL)
6530 0 0 if (comp_size > MZ_UINT32_MAX)
6543 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)
6549 0 0 if (pExtra_data != NULL)
6551 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6552 0 0 (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
0 0 (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
6555 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,
6581 0 0 if ((int)level_and_flags < 0)
6585 0 0 gen_flags = (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE) ? 0 : MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
6587 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
6591 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))
6596 0 0 if ((!pState->m_zip64) && (max_size > MZ_UINT32_MAX))
0 0 if ((!pState->m_zip64) && (max_size > MZ_UINT32_MAX))
6604 0 0 if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
6607 0 0 if (!mz_zip_writer_validate_archive_name(pArchive_name))
6610 0 0 if (pState->m_zip64)
6612 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
6617 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
6625 0 0 if (archive_name_size > MZ_UINT16_MAX)
6631 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)
6634 0 0 if (!pState->m_zip64)
6637 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 + archive_name_size + comment_size + user_extra_data_len + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 1024 + MZ_ZIP_DATA_DESCRIPTER_SIZE32 + user_extra_data_central_len) > 0xFFFFFFFF)
6645 0 0 if (pFile_time)
6653 0 0 if (max_size <= 3)
6656 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
6669 0 0 if (max_size && level)
0 0 if (max_size && level)
6675 0 0 if (pState->m_zip64)
6677 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)
6680 0 0 if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE)
6681 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,
6683 0 0 (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
6687 0 0 (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
6690 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))
6693 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))
6698 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6705 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
6712 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))
6714 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))
6717 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))
6722 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6730 0 0 if (user_extra_data_len > 0)
6732 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)
6738 0 0 if (max_size)
6741 0 0 if (!pRead_buf)
6746 0 0 if (!level)
6751 0 0 if (n == 0)
6754 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))
6759 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n)
6776 0 0 if (!pComp)
6786 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)
6799 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))
6808 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))
6811 0 0 if (n == 0)
6815 0 0 if (status == TDEFL_STATUS_DONE)
6820 0 0 else if (status != TDEFL_STATUS_OKAY)
6829 0 0 if (!result)
6843 0 0 if (!(level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE))
6850 0 0 if (pExtra_data == NULL)
6852 0 0 if (comp_size > MZ_UINT32_MAX)
6865 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)
6871 0 0 if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE)
6873 0 0 if (pExtra_data != NULL)
6875 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,
6876 0 0 (max_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
6879 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,
6888 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))
6891 0 0 if (pExtra_data != NULL)
6895 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
6902 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, extra_data, extra_size) != extra_size)
6909 0 0 if (pExtra_data != NULL)
6911 0 0 extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
6912 0 0 (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
0 0 (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
6915 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,
6981 0 0 if (!mz_zip_array_reserve(pZip, pNew_ext, ext_len + 64, MZ_FALSE))
0 0 if (!mz_zip_array_reserve(pZip, pNew_ext, ext_len + 64, MZ_FALSE))
6986 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))
6994 0 0 if (pUncomp_size)
7000 0 0 if (pComp_size)
7006 0 0 if (pLocal_header_ofs)
7012 0 0 if (pDisk_start)
7020 0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, new_ext_block, pDst - new_ext_block))
0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, new_ext_block, pDst - new_ext_block))
7024 0 0 if ((pExt) && (ext_len))
0 0 if ((pExt) && (ext_len))
7033 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
7040 0 0 if (field_total_size > extra_size_remaining)
7043 0 0 if (field_id != MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
7045 0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, pExtra_data, field_total_size))
0 0 if (!mz_zip_array_push_back(pZip, pNew_ext, pExtra_data, field_total_size))
7051 0 0 } while (extra_size_remaining);
7077 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))
7083 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))
7087 0 0 if (NULL == (pSrc_central_header = mz_zip_get_cdh(pSource_zip, src_file_index)))
7090 0 0 if (MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_SIG_OFS) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)
7099 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)
7104 0 0 if (!pState->m_zip64)
7106 0 0 if (pZip->m_total_files == MZ_UINT16_MAX)
7112 0 0 if (pZip->m_total_files == MZ_UINT32_MAX)
7116 0 0 if (!mz_zip_file_stat_internal(pSource_zip, src_file_index, pSrc_central_header, &src_file_stat, NULL))
7123 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)
7126 0 0 if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
7139 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)))
7146 0 0 if (!mz_zip_array_resize(pZip, &file_data_array, local_header_extra_len, MZ_FALSE))
0 0 if (!mz_zip_array_resize(pZip, &file_data_array, local_header_extra_len, MZ_FALSE))
7151 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)
7163 0 0 if (extra_size_remaining < (sizeof(mz_uint16) * 2))
7173 0 0 if (field_total_size > extra_size_remaining)
7179 0 0 if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
7183 0 0 if (field_data_size < sizeof(mz_uint64) * 2)
7198 0 0 } while (extra_size_remaining);
7203 0 0 if (!pState->m_zip64)
7210 0 0 if (approx_new_archive_size >= MZ_UINT32_MAX)
7215 0 0 if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs, num_alignment_padding_bytes))
7227 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)
7233 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)))))
7236 0 0 while (src_archive_bytes_remaining)
7238 0 0 n = (mz_uint)MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining);
7239 0 0 if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, n) != n)
7246 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
7258 0 0 if (bit_flags & 8)
7261 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))
7270 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))
7276 0 0 n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == MZ_ZIP_DATA_DESCRIPTOR_ID) ? 6 : 5);
7283 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)
7291 0 0 if (pZip->m_pState->m_zip64)
7294 0 0 const mz_uint8 *pSrc_descriptor = (const mz_uint8 *)pBuf + (has_id ? sizeof(mz_uint32) : 0);
7309 0 0 n = sizeof(mz_uint32) * (has_id ? 4 : 3);
7313 0 0 if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
7329 0 0 if (pState->m_zip64)
7341 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))
7349 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
7355 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))
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))
7358 0 0 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
7362 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_ext_block.m_p, new_ext_block.m_size))
0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_ext_block.m_p, new_ext_block.m_size))
7365 0 0 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
7369 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))
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))
7372 0 0 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
7381 0 0 if (cur_dst_file_ofs > MZ_UINT32_MAX)
7384 0 0 if (local_dir_header_ofs >= MZ_UINT32_MAX)
7389 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
7392 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))
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))
7394 0 0 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
7400 0 0 if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
7403 0 0 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
7408 0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1))
0 0 if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1))
7410 0 0 mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
7426 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))
7431 0 0 if (pState->m_zip64)
7433 0 0 if ((mz_uint64)pState->m_central_dir.m_size >= MZ_UINT32_MAX)
7438 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))
7444 0 0 if (pZip->m_total_files)
7450 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)
7456 0 0 if (pState->m_zip64)
7470 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)
7480 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)
7489 0 0 MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
7490 0 0 MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
7491 0 0 MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_size));
7492 0 0 MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_ofs));
7494 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)
7510 0 0 if ((!ppBuf) || (!pSize))
0 0 if ((!ppBuf) || (!pSize))
7516 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7519 0 0 if (pZip->m_pWrite != mz_zip_heap_write_func)
7522 0 0 if (!mz_zip_writer_finalize_archive(pZip))
7689 0 0 return pZip ? pZip->m_zip_mode : MZ_ZIP_MODE_INVALID;
7694 0 0 return pZip ? pZip->m_zip_type : MZ_ZIP_TYPE_INVALID;
7701 0 0 if (!pZip)
7712 0 0 if (!pZip)
7727 0 0 if (!pZip)
7816 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7824 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7832 0 0 return pZip ? pZip->m_total_files : 0;
7837 0 0 if (!pZip)
7844 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7851 0 0 if ((!pZip) || (!pZip->m_pState))
0 0 if ((!pZip) || (!pZip->m_pState))
7858 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))
7864 0 0 mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size)
7868 0 0 if (!p)
7870 0 0 if (filename_buf_size)
7876 0 0 if (filename_buf_size)
7885 0 0 mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat)
7892 0 0 if (!pZip)
7895 0 0 if (pZip->m_zip_mode == MZ_ZIP_MODE_READING)
7898 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))