mirror of
https://github.com/google/brotli.git
synced 2024-11-21 19:20:09 +00:00
Fix emitting 1-byte long metadata block
PiperOrigin-RevId: 505484299
This commit is contained in:
parent
1e61e972fb
commit
04f294b18a
@ -1188,7 +1188,7 @@ static size_t WriteMetadataHeader(
|
||||
if (block_size == 0) {
|
||||
BrotliWriteBits(2, 0, &storage_ix, header);
|
||||
} else {
|
||||
uint32_t nbits = (block_size == 1) ? 0 :
|
||||
uint32_t nbits = (block_size == 1) ? 1 :
|
||||
(Log2FloorNonZero((uint32_t)block_size - 1) + 1);
|
||||
uint32_t nbytes = (nbits + 7) / 8;
|
||||
BrotliWriteBits(2, nbytes, &storage_ix, header);
|
||||
|
Loading…
Reference in New Issue
Block a user