diff options
author | Rene Engelhard <rene@debian.org> | 2010-11-26 17:42:02 +0100 |
---|---|---|
committer | Rene Engelhard <rene@debian.org> | 2010-11-26 17:42:02 +0100 |
commit | 580a800a1d059ec54d54298db71765fafb2872a8 (patch) | |
tree | 608198d8e34ec6ea3112fb0bb5caf29d75853f98 | |
parent | 56a6681b4292702677a9bfc3ee0b8903a4bbc99e (diff) | |
parent | e2bbfbc07382adcac481920e1c4cec9fa89557b5 (diff) |
Merge commit 'ooo/OOO330_m17' into libreoffice-3-3
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 17 |
2 files changed, 21 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 3481b80de6..76c6ae1b2c 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5222,7 +5222,14 @@ ULONG WW8Reader::Read(SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, const St } SwWW8ImplReader* pRdr = new SwWW8ImplReader(nVersion, pStg, pIn, rDoc, rBaseURL, bNew); - nRet = pRdr->LoadDoc( rPam ); + try + { + nRet = pRdr->LoadDoc( rPam ); + } + catch( const std::exception& ) + { + nRet = ERR_WW8_NO_WW8_FILE_ERR; + } delete pRdr; if( refStrm.Is() ) diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 2506c95ebc..653595a32a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -897,11 +897,18 @@ void WW8SprmIter::SetSprms(const BYTE* pSprms_, long nLen_) const BYTE* WW8SprmIter::operator ++( int ) { - if (nRemLen > 0) + if (nRemLen > 0 ) { - pSprms += nAktSize; - nRemLen -= nAktSize; - UpdateMyMembers(); + if( nRemLen >= nAktSize ) + { + pSprms += nAktSize; + nRemLen -= nAktSize; + UpdateMyMembers(); + } + else + { + throw( ::std::exception() ); + } } return pSprms; } @@ -3252,6 +3259,8 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p) Otherwise our cool fastsave algorithm can be brought to bear on the problem. */ + if( !pPieceIter ) + return; ULONG nOldPos = pPieceIter->GetIdx(); bool bOk = pPieceIter->SeekPos(nOrigCp); pPieceIter->SetIdx( nOldPos ); |