mirror of
https://github.com/google/brotli.git
synced 2024-09-18 22:00:00 +00:00
Add BrotliCopyPreloadedSymbols function.
Add a single trivial use to avoid complier warning. PiperOrigin-RevId: 671098230
This commit is contained in:
parent
39bcecf455
commit
d6dc555eee
@ -1899,6 +1899,22 @@ static BROTLI_INLINE BROTLI_BOOL CheckInputAmount(
|
||||
} \
|
||||
}
|
||||
|
||||
/* Reads up to limit symbols from br and copies them into ringbuffer,
|
||||
starting from pos. Caller must ensure that this is safe. */
|
||||
static BROTLI_INLINE void BrotliCopyPreloadedSymbols(BrotliBitReader* br,
|
||||
brotli_reg_t* bits,
|
||||
brotli_reg_t* value,
|
||||
BrotliDecoderState* s,
|
||||
int pos,
|
||||
int limit) {
|
||||
int pos_limit = pos + limit;
|
||||
for (; pos < pos_limit; pos++) {
|
||||
s->ringbuffer[pos] =
|
||||
(uint8_t)ReadPreloadedSymbol(s->literal_htree, br, bits, value);
|
||||
BROTLI_LOG_ARRAY_INDEX(s->ringbuffer, pos);
|
||||
}
|
||||
}
|
||||
|
||||
static BROTLI_INLINE BrotliDecoderErrorCode ProcessCommandsInternal(
|
||||
int safe, BrotliDecoderState* s) {
|
||||
int pos = s->pos;
|
||||
@ -1969,8 +1985,7 @@ CommandInner:
|
||||
goto NextLiteralBlock;
|
||||
}
|
||||
if (!safe) {
|
||||
s->ringbuffer[pos] =
|
||||
(uint8_t)ReadPreloadedSymbol(s->literal_htree, br, &bits, &value);
|
||||
BrotliCopyPreloadedSymbols(br, &bits, &value, s, pos, 1);
|
||||
} else {
|
||||
brotli_reg_t literal;
|
||||
if (!SafeReadSymbol(s->literal_htree, br, &literal)) {
|
||||
|
Loading…
Reference in New Issue
Block a user