diff options
author | Eugene Kliuchnikov <eustas.ru@gmail.com> | 2020-05-15 11:06:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-15 11:06:21 +0200 |
commit | 7f740f1308336e9ec0afdb9434896307859f5dc9 (patch) | |
tree | 72841d92798fabcfaec0b95091420ac37c82b86f /c/dec | |
parent | f83aa5169e3c09afa8db84d1180fd1fe8813118a (diff) | |
download | brotli-7f740f1308336e9ec0afdb9434896307859f5dc9.zip brotli-7f740f1308336e9ec0afdb9434896307859f5dc9.tar.gz brotli-7f740f1308336e9ec0afdb9434896307859f5dc9.tar.bz2 |
Update (#807)
- fix formatting
- fix type conversion
- fix no-op arithmetic with null-pointer
- improve performance of hash_longest_match64
- go: detect read after close
- java decoder: support compound dictionary
- remove executable flag on non-scripts
Diffstat (limited to 'c/dec')
-rw-r--r-- | c/dec/decode.c | 6 | ||||
-rw-r--r-- | c/dec/huffman.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/c/dec/decode.c b/c/dec/decode.c index 114c505..9cdbb57 100644 --- a/c/dec/decode.c +++ b/c/dec/decode.c @@ -275,7 +275,8 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE DecodeMetaBlockLength( s->loop_counter = i; return BROTLI_DECODER_NEEDS_MORE_INPUT; } - if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 4 && bits == 0) { + if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 4 && + bits == 0) { return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE); } s->meta_block_remaining_len |= (int)(bits << (i * 4)); @@ -324,7 +325,8 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE DecodeMetaBlockLength( s->loop_counter = i; return BROTLI_DECODER_NEEDS_MORE_INPUT; } - if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 1 && bits == 0) { + if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 1 && + bits == 0) { return BROTLI_FAILURE( BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE); } diff --git a/c/dec/huffman.h b/c/dec/huffman.h index 70e8469..2e01447 100644 --- a/c/dec/huffman.h +++ b/c/dec/huffman.h @@ -83,7 +83,7 @@ typedef BROTLI_ALIGNED(4) uint32_t HuffmanCode; static BROTLI_INLINE HuffmanCode ConstructHuffmanCode(const uint8_t bits, const uint16_t value) { - return ((value & 0xFFFF) << 16) | (bits & 0xFF); + return (HuffmanCode) ((value & 0xFFFF) << 16) | (bits & 0xFF); } #define BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(H) uint32_t __fastload_##H = (*H) |