diff --git a/heatshrink_encoder.c b/heatshrink_encoder.c index edf4abe..d92ea70 100644 --- a/heatshrink_encoder.c +++ b/heatshrink_encoder.c @@ -425,9 +425,9 @@ static void do_indexing(heatshrink_encoder *hse) { int16_t * const index = hsi->index; const uint16_t input_offset = get_input_offset(hse); - const uint16_t end = input_offset + hse->input_size; + const uint16_t end = (input_offset - 1) + hse->input_size; - for (uint16_t i=0; i