Buffer is expanded not only Z_OK, but also Z_BUF_ERROR case.
This commit is contained in:
Takatoshi Kondo 2019-07-12 21:55:50 +09:00
parent 7e23ec496a
commit 6954e01338
2 changed files with 2 additions and 0 deletions

View File

@ -69,6 +69,7 @@ public:
case Z_STREAM_END:
return m_data;
case Z_OK:
case Z_BUF_ERROR:
if(!expand()) {
throw std::bad_alloc();
}

View File

@ -146,6 +146,7 @@ static inline char* msgpack_zbuffer_flush(msgpack_zbuffer* zbuf)
case Z_STREAM_END:
return zbuf->data;
case Z_OK:
case Z_BUF_ERROR:
if(!msgpack_zbuffer_expand(zbuf)) {
return NULL;
}