Do not return Z_BUF_ERROR if deflateParam() has nothing to write.
If the compressed data was already at a block boundary, then deflateParam() would report Z_BUF_ERROR, because there was nothing to write. With this patch, Z_OK is returned in that case.
This commit is contained in:
@@ -513,6 +513,8 @@ int ZEXPORT deflateParams(strm, level, strategy)
|
|||||||
strm->total_in != 0) {
|
strm->total_in != 0) {
|
||||||
/* Flush the last buffer: */
|
/* Flush the last buffer: */
|
||||||
err = deflate(strm, Z_BLOCK);
|
err = deflate(strm, Z_BLOCK);
|
||||||
|
if (err == Z_BUF_ERROR && s->pending == 0)
|
||||||
|
err = Z_OK;
|
||||||
}
|
}
|
||||||
if (s->level != level) {
|
if (s->level != level) {
|
||||||
s->level = level;
|
s->level = level;
|
||||||
|
|||||||
Reference in New Issue
Block a user