]> wimlib.net Git - wimlib/commitdiff
read_huffsym optimization
authorEric Biggers <ebiggers3@gmail.com>
Sun, 3 Jul 2016 22:33:20 +0000 (17:33 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 3 Jul 2016 22:33:20 +0000 (17:33 -0500)
include/wimlib/decompress_common.h

index c3016475b2c07f812d6d2285443e51839545c83f..e61677b9964bf35c56956623393bda6cc106c142 100644 (file)
@@ -237,7 +237,7 @@ read_huffsym(struct input_bitstream *istream, const u16 decode_table[],
        /* Index the decode table by the next table_bits bits of the input.  */
        key_bits = bitstream_peek_bits(istream, table_bits);
        entry = decode_table[key_bits];
-       if (likely(entry < 0xC000)) {
+       if (likely(table_bits >= max_codeword_len || entry < 0xC000)) {
                /* Fast case: The decode table directly provided the
                 * symbol and codeword length.  The low 11 bits are the
                 * symbol, and the high 5 bits are the codeword length.  */