X-Git-Url: https://git.sesse.net/?p=fjl;a=blobdiff_plain;f=driver.c;h=c5ae87e3b003cc2b060ccfe3fa1571ff817a2246;hp=cda257e3c90ba023ed8b465eeedf2e1417768aff;hb=a1596fbb6a92217ff5eb57600b36a9d695ca1ae8;hpb=1cfb04470add4e31406785980e7ce14a8e9d0672 diff --git a/driver.c b/driver.c index cda257e..c5ae87e 100644 --- a/driver.c +++ b/driver.c @@ -120,8 +120,6 @@ void decode_ac_coefficients(const struct huffman_table* tbl, struct bit_source* possibly_refill(bits, DEHUF_AC_TABLE_BITS); unsigned lookup = peek_bits(bits, DEHUF_AC_TABLE_BITS); int code = tbl->ac_table_codes[lookup]; - int length = tbl->ac_table_length[lookup]; - int r = tbl->ac_table_skip[lookup]; assert(length == AC_DEHUF_SLOW_PATH || (length > 0 && length <= DEHUF_AC_TABLE_BITS)); @@ -145,6 +143,8 @@ void decode_ac_coefficients(const struct huffman_table* tbl, struct bit_source* coeff[unzigzag[i]] = extend(read_bits(bits, s), s); } else { + int length = tbl->ac_table_length[lookup]; + int r = tbl->ac_table_skip[lookup]; assert(r >= 0); i += r; assert(bits->bits_available >= length);