aboutsummaryrefslogtreecommitdiff
path: root/python/brotlimodule.cc
diff options
context:
space:
mode:
Diffstat (limited to 'python/brotlimodule.cc')
-rw-r--r--python/brotlimodule.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/brotlimodule.cc b/python/brotlimodule.cc
index bc7ea08..269de2d 100644
--- a/python/brotlimodule.cc
+++ b/python/brotlimodule.cc
@@ -191,7 +191,7 @@ static PyObject* brotli_decompress(PyObject *self, PyObject *args) {
ok = BrotliDecompress(in, out);
if (ok) {
- ret = PyBytes_FromStringAndSize((char*)output.data(), output.size());
+ ret = PyBytes_FromStringAndSize((char*)(output.size() ? &output[0] : NULL), output.size());
} else {
PyErr_SetString(BrotliError, "BrotliDecompress failed");
}