Fixed alignment problems on MacOS

This commit is contained in:
Francois Nedelec 2022-04-01 14:34:04 +01:00
parent 5a38f5564a
commit e7d0e216d5

View File

@ -475,7 +475,7 @@ static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d)
if (flags & 1)
{
mz_uint s0, s1, n0, n1, sym, num_extra_bits;
mz_uint match_len = pLZ_codes[0], match_dist = *(const mz_uint16 *)(pLZ_codes + 1);
mz_uint match_len = pLZ_codes[0]; match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8));
pLZ_codes += 3;
MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
@ -520,7 +520,7 @@ static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d)
if (pOutput_buf >= d->m_pOutput_buf_end)
return MZ_FALSE;
*(mz_uint64 *)pOutput_buf = bit_buffer;
memcpy(pOutput_buf, &bit_buffer, 8);
pOutput_buf += (bits_in >> 3);
bit_buffer >>= (bits_in & ~7);
bits_in &= 7;