[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sw/source
Michael Meeks
michael at kemper.freedesktop.org
Mon Jan 30 11:52:21 PST 2012
sw/source/filter/ww8/ww8scan.cxx | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
New commits:
commit 6594688df45cb491042470c4ae5289c47192994a
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Mon Jan 30 19:07:43 2012 +0100
query remaining stream size after seeking, not before (fdo#45255)
Signed-off-by: Michael Meeks <michael.meeks at suse.com>
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 9ef2ff9..b149478 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1996,10 +1996,11 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos,
const sal_uInt32 nValidMin=4;
sal_Size nOldPos = pSt->Tell();
- sal_Size nRemainingSize = pSt->remainingSize();
- bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
- (nPLCF >= nValidMin);
+ bool bValid = checkSeek(*pSt, nFilePos);
+ sal_Size nRemainingSize = pSt->remainingSize();
+ if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin ))
+ bValid = false;
nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin;
// Pointer auf Pos- u. Struct-Array
@@ -2154,9 +2155,7 @@ WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
void WW8PLCF::ReadPLCF(SvStream& rSt, WW8_FC nFilePos, sal_uInt32 nPLCF)
{
sal_Size nOldPos = rSt.Tell();
- sal_Size nRemainingSize = rSt.remainingSize();
-
- bool bValid = checkSeek(rSt, nFilePos) && (nRemainingSize >= nPLCF);
+ bool bValid = checkSeek(rSt, nFilePos) && (rSt.remainingSize() >= nPLCF);
if (bValid)
{
@@ -2335,10 +2334,11 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos,
const sal_uInt32 nValidMin=4;
sal_Size nOldPos = pSt->Tell();
- sal_Size nRemainingSize = pSt->remainingSize();
- bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
- (nPLCF >= nValidMin);
+ bool bValid = checkSeek(*pSt, nFilePos);
+ sal_Size nRemainingSize = pSt->remainingSize();
+ if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin ))
+ bValid = false;
nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin;
pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ]; // Pointer auf Pos-Array
More information about the Libreoffice-commits
mailing list