mirror of
https://github.com/google/brotli.git
synced 2024-11-22 19:50:06 +00:00
Merge pull request #175 from szabadka/master
Fix a bug in uncompressed block handling.
This commit is contained in:
commit
6dd53d6183
@ -838,7 +838,6 @@ BrotliResult BROTLI_NOINLINE CopyUncompressedBlockToOutput(BrotliOutput output,
|
||||
break;
|
||||
}
|
||||
if (s->substate_uncompressed == BROTLI_STATE_UNCOMPRESSED_WRITE_1) {
|
||||
s->meta_block_remaining_len -= s->ringbuffer_size;
|
||||
/* If we wrote past the logical end of the ringbuffer, copy the tail
|
||||
of the ringbuffer to its beginning and flush the ringbuffer to the
|
||||
output. */
|
||||
|
@ -93,6 +93,16 @@ BrotliOutput BrotliFileOutput(FILE* f) {
|
||||
return out;
|
||||
}
|
||||
|
||||
int BrotliNullOutputFunction(void* data, const uint8_t* buf, size_t count) {
|
||||
return (int)count;
|
||||
}
|
||||
|
||||
BrotliOutput BrotliNullOutput() {
|
||||
BrotliOutput out;
|
||||
out.cb_ = BrotliNullOutputFunction;
|
||||
out.data_ = NULL;
|
||||
return out;
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} /* extern "C" */
|
||||
|
@ -93,6 +93,10 @@ BrotliInput BrotliFileInput(FILE* f);
|
||||
int BrotliFileOutputFunction(void* data, const uint8_t* buf, size_t count);
|
||||
BrotliOutput BrotliFileOutput(FILE* f);
|
||||
|
||||
/* Output callback that does nothing, always consumes the whole input. */
|
||||
int BrotliNullOutputFunction(void* data, const uint8_t* buf, size_t count);
|
||||
BrotliOutput BrotliNullOutput();
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user