diff --git a/igzip/encode_df.c b/igzip/encode_df.c index a3ce929..d26d1c9 100644 --- a/igzip/encode_df.c +++ b/igzip/encode_df.c @@ -23,7 +23,7 @@ struct deflate_icf *encode_deflate_icf_base(struct deflate_icf *next_in, while (next_in < end_in && !is_full(bb)) { lsym = hufftables->lit_len_table[next_in->lit_len]; - dsym = hufftables->dist_table[next_in->lit_dist]; + dsym = hufftables->dist_lit_table[next_in->lit_dist]; // insert ll code, dist_code, and extra_bits write_bits_unsafe(bb, lsym.code_and_extra, lsym.length); diff --git a/igzip/huff_codes.h b/igzip/huff_codes.h index f219135..d353d27 100644 --- a/igzip/huff_codes.h +++ b/igzip/huff_codes.h @@ -138,8 +138,17 @@ struct rl_code { }; struct hufftables_icf { - struct huff_code dist_table[31]; - struct huff_code lit_len_table[513]; + union { + struct { + struct huff_code dist_lit_table[288]; + struct huff_code len_table[256]; + }; + + struct { + struct huff_code dist_table[31]; + struct huff_code lit_len_table[513]; + }; + }; }; /**