aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/brotlimodule.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/brotlimodule.cc b/python/brotlimodule.cc
index de3f095..9e8c01a 100644
--- a/python/brotlimodule.cc
+++ b/python/brotlimodule.cc
@@ -174,7 +174,7 @@ static PyObject* brotli_compress(PyObject *self, PyObject *args, PyObject *keywd
end:
BrotliEncoderDestroyInstance(enc);
if (ok) {
- ret = PyBytes_FromStringAndSize((char*)output, output_length);
+ ret = PyBytes_FromStringAndSize((char*)output, output_length - available_out);
} else {
PyErr_SetString(BrotliError, "BrotliCompressBuffer failed");
}