diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-07-06 11:13:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-07-06 12:28:20 +0100 |
commit | 5aff134960b046a05f6255d10fd6d8ec72a3ff41 (patch) | |
tree | e88651124806f4305e0bcb290afeaa946072afaf /tools | |
parent | b8f99f254bd3c1e05b40103be999bf83fc22fc35 (diff) |
only inflate if status from InitDecompress is good
Change-Id: Ief207205b3f05dd0ed92a2d1d30e265cbdb914e3
Diffstat (limited to 'tools')
-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 ed21965e98b1..d6b916994f73 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) : -1; 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) : -1; 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) : -1; if ( err < 0 ) { // Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK. |