Skip to content
Snippets Groups Projects
Commit f6effe49 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

udeflate: fix off-by-one in static huffman dictionary generation

parent 252524c2
No related branches found
No related tags found
No related merge requests found
...@@ -314,19 +314,19 @@ static int8_t udeflate_static_huffman() ...@@ -314,19 +314,19 @@ static int8_t udeflate_static_huffman()
for (i = 256; i <= 279; i++) { for (i = 256; i <= 279; i++) {
udeflate_lld_lengths[i] = 7; udeflate_lld_lengths[i] = 7;
} }
for (i = 280; i <= 284; i++) { for (i = 280; i <= 285; i++) {
udeflate_lld_lengths[i] = 8; udeflate_lld_lengths[i] = 8;
} }
for (i = 285; i <= 285 + 29; i++) { for (i = 286; i <= 286 + 29; i++) {
udeflate_lld_lengths[i] = 5; udeflate_lld_lengths[i] = 5;
} }
udeflate_build_alphabet(udeflate_lld_lengths, 285, udeflate_bl_count_ll, udeflate_build_alphabet(udeflate_lld_lengths, 286, udeflate_bl_count_ll,
udeflate_next_code_ll); udeflate_next_code_ll);
udeflate_build_alphabet(udeflate_lld_lengths + 285, 29, udeflate_build_alphabet(udeflate_lld_lengths + 286, 29,
udeflate_bl_count_d, udeflate_next_code_d); udeflate_bl_count_d, udeflate_next_code_d);
return udeflate_huffman(udeflate_lld_lengths, 285, return udeflate_huffman(udeflate_lld_lengths, 286,
udeflate_lld_lengths + 285, 29); udeflate_lld_lengths + 286, 29);
} }
static int8_t udeflate_dynamic_huffman() static int8_t udeflate_dynamic_huffman()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment