aboutsummaryrefslogtreecommitdiff
path: root/c/dec
diff options
context:
space:
mode:
authorEugene Kliuchnikov <eustas@google.com>2017-11-28 15:37:28 +0100
committerGitHub <noreply@github.com>2017-11-28 15:37:28 +0100
commit0ad94eed00420bf1154cb16a289aa27efbb30c01 (patch)
tree8b20dcaadf99b2373d23a13cab99dc7d2f56098d /c/dec
parent273de5a22f955ba84ad3d31025bff69054cc98ef (diff)
downloadbrotli-0ad94eed00420bf1154cb16a289aa27efbb30c01.tar.gz
Update (#620)
* add autotools build * separate semantic and ABI version * extract sources.lst (used by CMake and Automake) * share pkgconfig templates (used by CMake and Automake) * decoder: always set `total_out` * encoder: fix `BROTLI_ENSURE_CAPACITY` macro (no-op after preprocessor) * decoder/encoder: refine `free_func` contract
Diffstat (limited to 'c/dec')
-rw-r--r--c/dec/decode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/c/dec/decode.c b/c/dec/decode.c
index be8de42..24da35b 100644
--- a/c/dec/decode.c
+++ b/c/dec/decode.c
@@ -1911,6 +1911,10 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
size_t* available_out, uint8_t** next_out, size_t* total_out) {
BrotliDecoderErrorCode result = BROTLI_DECODER_SUCCESS;
BrotliBitReader* br = &s->br;
+ /* Ensure that *total_out is set, even if no data will ever be pushed out. */
+ if (total_out) {
+ *total_out = s->partial_pos_out;
+ }
/* Do not try to process further in a case of unrecoverable error. */
if ((int)s->error_code < 0) {
return BROTLI_DECODER_RESULT_ERROR;