Fix a bug in the fast Huffman decoder.
authorSteinar H. Gunderson <sesse@debian.org>
Sat, 3 Jan 2009 12:43:29 +0000 (13:43 +0100)
committerSteinar H. Gunderson <sesse@debian.org>
Sat, 3 Jan 2009 12:43:29 +0000 (13:43 +0100)
dehuff.c

index af16b512a83c0f796fd24ff8a499e15fe3719817..c4a65eea8a0619153bb9910cd5421db53bd01193 100644 (file)
--- a/dehuff.c
+++ b/dehuff.c
@@ -114,7 +114,7 @@ void read_huffman_tables(huffman_tables_t* dst, input_func_t* input_func, void*
                                for (unsigned elem = prefix_min; elem < prefix_max; ++elem) {
                                        assert(tbl->lookup_table_codes[elem] == DEHUF_SLOW_PATH);
                                        assert(tbl->lookup_table_length[elem] == DEHUF_SLOW_PATH);
-                                       tbl->lookup_table_codes[elem] = k;
+                                       tbl->lookup_table_codes[elem] = tbl->codes[k];
                                        tbl->lookup_table_length[elem] = length;
                                }
                        }