diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-06 11:13:10 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-07-08 12:04:15 +0200 |
commit | e4bb2b1c2138688bdb30c3f59389b320f16dc753 (patch) | |
tree | 30f6622cf2f852d2360eea67a357f91f08c6d99c /tools/source | |
parent | 52855e8ebc83a12a81d24f9be195f117ede56815 (diff) |
only inflate if status from InitDecompress is good
Change-Id: Ief207205b3f05dd0ed92a2d1d30e265cbdb914e3
(cherry picked from commit 5aff134960b046a05f6255d10fd6d8ec72a3ff41)
-1 -> Z_ERRNO for clarity
Change-Id: I29aa8531646f416a72b89f7571b757c39705c31a
(cherry picked from commit 8cb69cc82c11b640c0328f4788c05bed1ac15e90)
Reviewed-on: https://gerrit.libreoffice.org/16827
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/zcodec/zcodec.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index 5069b7c7d750..a2ea241b3f63 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -153,7 +153,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm ) UpdateCRC( mpInBuf, nInToRead ); } - err = inflate( PZSTREAM, Z_NO_FLUSH ); + err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO; if ( err < 0 ) { mbStatus = false; @@ -220,7 +220,7 @@ long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize ) UpdateCRC( mpInBuf, nInToRead ); } - err = inflate( PZSTREAM, Z_NO_FLUSH ); + err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO; if ( err < 0 ) { // Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK. @@ -273,7 +273,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize UpdateCRC( mpInBuf, nInToRead ); } - err = inflate( PZSTREAM, Z_NO_FLUSH ); + err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO; if ( err < 0 ) { // Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK. |