aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authoreustas <eustas.ru@gmail.com>2016-06-23 11:02:53 +0200
committerGitHub <noreply@github.com>2016-06-23 11:02:53 +0200
commit27f9d00efc10f7f43127baeed1e3315475422e69 (patch)
treed064255b490168b0388f5fdf994b804fb63a637d /python
parent2c16351987e96134223afa091e38464fba8ca7d5 (diff)
downloadbrotli-27f9d00efc10f7f43127baeed1e3315475422e69.zip
brotli-27f9d00efc10f7f43127baeed1e3315475422e69.tar.gz
brotli-27f9d00efc10f7f43127baeed1e3315475422e69.tar.bz2
Fix issue #383
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");
}