diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2013-03-24 22:12:31 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2013-03-24 22:15:04 -0700 |
commit | c661c374e8df43365738daa09f4390d61bc57f08 (patch) | |
tree | 6aacaf41324478393daa5fb098a484bc0e9e0f6c | |
parent | 81c3068b9ac4e75a4c65338e5b95f421478f5295 (diff) | |
download | zlib-c661c374e8df43365738daa09f4390d61bc57f08.tar.gz zlib-c661c374e8df43365738daa09f4390d61bc57f08.tar.bz2 zlib-c661c374e8df43365738daa09f4390d61bc57f08.zip |
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.
-rw-r--r-- | deflate.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -513,6 +513,8 @@ int ZEXPORT deflateParams(strm, level, strategy) strm->total_in != 0) { /* Flush the last buffer: */ err = deflate(strm, Z_BLOCK); + if (err == Z_BUF_ERROR && s->pending == 0) + err = Z_OK; } if (s->level != level) { s->level = level; |