Commit f36c91d0 authored by Andre Maroneze's avatar Andre Maroneze 💬
Browse files

[miniz] fix initialization issues in original code

parent 753494b8
......@@ -1333,6 +1333,7 @@ tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_fun
d->m_output_flush_ofs = d->m_output_flush_remaining = d->m_finished = d->m_block_index = d->m_bit_buffer = d->m_wants_to_finish = 0;
d->m_pLZ_code_buf = d->m_lz_code_buf + 1;
d->m_pLZ_flags = d->m_lz_code_buf;
*d->m_pLZ_flags = 0;
d->m_num_flags_left = 8;
d->m_pOutput_buf = d->m_output_buf;
d->m_pOutput_buf_end = d->m_output_buf;
......
......@@ -87,11 +87,17 @@ typedef enum {
} tinfl_status;
/* Initializes the decompressor to its initial state. */
#define tinfl_init(r) \
do \
{ \
(r)->m_state = 0; \
} \
#define tinfl_init(r) \
do \
{ \
(r)->m_state = 0; \
(r)->m_num_bits = 0; \
(r)->m_bit_buf = 0; \
(r)->m_dist = 0; \
(r)->m_counter = 0; \
(r)->m_num_extra = 0; \
(r)->m_dist_from_out_buf_start = 0; \
} \
MZ_MACRO_END
#define tinfl_get_adler32(r) (r)->m_check_adler32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment