diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2018-06-18 11:11:54 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2018-06-18 11:13:57 +0100 |
commit | 7149b17577f04f3c34d6e1c938eeaf88c06b10ad (patch) | |
tree | fe2c69cd57d55ceeb0e62ecda14a2c86406a068c /src/lzw.c | |
parent | 50e568df2ca8252019460a7d43cb83efa600d02d (diff) | |
download | libnsgif-7149b17577f04f3c34d6e1c938eeaf88c06b10ad.tar.gz |
LZW decoder: Tiny optimisation.
When the next code fits exactly in what's left of the
current sub-block, we can use the fast path.
Spotted by Adrian Lees.
Diffstat (limited to 'src/lzw.c')
-rw-r--r-- | src/lzw.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -163,7 +163,7 @@ static inline lzw_result lzw__next_code( assert(byte_advance <= 2); - if (ctx->sb_bit + code_size < ctx->sb_bit_count) { + if (ctx->sb_bit + code_size <= ctx->sb_bit_count) { /* Fast path: code fully inside this sub-block */ const uint8_t *data = ctx->sb_data + (ctx->sb_bit >> 3); switch (byte_advance) { |