X-Git-Url: https://git.sesse.net/?p=fjl;a=blobdiff_plain;f=driver.c;h=d5bec84f8db5101aa33d6010c2de831e8f85339a;hp=616b613f944ee5ae3ba12a69476eb37d9b20a336;hb=165a5b18aeeaaa0f27ea63c8c0d0bcbe87bc5aaa;hpb=a4009687c73083dd0290285a065740a83e27e855 diff --git a/driver.c b/driver.c index 616b613..d5bec84 100644 --- a/driver.c +++ b/driver.c @@ -180,6 +180,7 @@ void read_scan(struct byte_source* source, struct jpeg_image* image, huffman_tab unsigned rs = read_huffman_symbol_no_refill(ac_table, &bits); unsigned r = rs >> 4; unsigned s = rs & 0xf; + i += r; if (rs == 0x00) { /* end of block */ @@ -188,10 +189,8 @@ void read_scan(struct byte_source* source, struct jpeg_image* image, huffman_tab if (rs == 0xf0) { /* 16 zero coefficients */ possibly_refill(&bits, DEHUF_TABLE_BITS); - i += 15; continue; } - i += r; possibly_refill(&bits, s + DEHUF_TABLE_BITS); coeff[unzigzag[i]] = extend(read_bits(&bits, s), s);