Kaydet (Commit) 5960ce4d authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

only inflate if status from InitDecompress is good

Change-Id: Ief207205b3f05dd0ed92a2d1d30e265cbdb914e3
(cherry picked from commit 5aff1349)

-1 -> Z_ERRNO for clarity

Change-Id: I29aa8531646f416a72b89f7571b757c39705c31a
(cherry picked from commit 8cb69cc8)
Reviewed-on: https://gerrit.libreoffice.org/16826Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst e5f81b69
...@@ -153,7 +153,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm ) ...@@ -153,7 +153,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
UpdateCRC( mpInBuf, nInToRead ); UpdateCRC( mpInBuf, nInToRead );
} }
err = inflate( PZSTREAM, Z_NO_FLUSH ); err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO;
if ( err < 0 ) if ( err < 0 )
{ {
mbStatus = false; mbStatus = false;
...@@ -220,7 +220,7 @@ long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize ) ...@@ -220,7 +220,7 @@ long ZCodec::Read( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize )
UpdateCRC( mpInBuf, nInToRead ); UpdateCRC( mpInBuf, nInToRead );
} }
err = inflate( PZSTREAM, Z_NO_FLUSH ); err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO;
if ( err < 0 ) if ( err < 0 )
{ {
// Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK. // Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK.
...@@ -273,7 +273,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize ...@@ -273,7 +273,7 @@ long ZCodec::ReadAsynchron( SvStream& rIStm, sal_uInt8* pData, sal_uIntPtr nSize
UpdateCRC( mpInBuf, nInToRead ); UpdateCRC( mpInBuf, nInToRead );
} }
err = inflate( PZSTREAM, Z_NO_FLUSH ); err = mbStatus ? inflate(PZSTREAM, Z_NO_FLUSH) : Z_ERRNO;
if ( err < 0 ) if ( err < 0 )
{ {
// Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK. // Accept Z_BUF_ERROR as EAGAIN or EWOULDBLOCK.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment