diff options
Diffstat (limited to 'c/dec/decode.c')
-rw-r--r-- | c/dec/decode.c | 4 |
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; |