[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Tue Sep 26 19:21:25 UTC 2017
sw/source/filter/ww8/ww8graf2.cxx | 10 ++++++----
sw/source/filter/ww8/ww8scan.cxx | 4 +++-
2 files changed, 9 insertions(+), 5 deletions(-)
New commits:
commit 09f0194a9e0367ae1e06cf5608376bd99953ddf0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Sep 26 11:45:04 2017 +0100
ofz#2980 timeout
Change-Id: Id54a6ef74059885728c1dffec10d67c9f56ba684
Reviewed-on: https://gerrit.libreoffice.org/42797
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 0ab278d9dbb4..5e7b7da6bf6a 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -493,14 +493,16 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj,
* stream then contains the PICF and the corresponding graphic!
* We otherwise map the variable pDataStream to pStream.
*/
- sal_uLong nOldPos = m_pDataStream->Tell();
+ auto nOldPos = m_pDataStream->Tell();
WW8_PIC aPic;
- m_pDataStream->Seek( m_nPicLocFc );
- PicRead( m_pDataStream, &aPic, m_bVer67);
+ bool bValid = checkSeek(*m_pDataStream, m_nPicLocFc);
+
+ if (bValid)
+ PicRead( m_pDataStream, &aPic, m_bVer67);
// Sanity check is needed because for example check boxes in field results
// contain a WMF-like struct
- if (m_pDataStream->good() && (aPic.lcb >= 58))
+ if (bValid && m_pDataStream->good() && (aPic.lcb >= 58))
{
if( m_pFlyFormatOfJustInsertedGraphic )
{
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 9c6f46752004..a9825a5c3fe2 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1894,7 +1894,9 @@ sal_Int32 WW8ScannerBase::WW8ReadString( SvStream& rStrm, OUString& rStr,
if( !bPosOk )
break;
- rStrm.Seek( fcAct );
+ bool bValid = checkSeek(rStrm, fcAct);
+ if (!bValid)
+ break;
long nLen = ( (nNextPieceCp < nBehindTextCp) ? nNextPieceCp
: nBehindTextCp ) - nAktStartCp;
More information about the Libreoffice-commits
mailing list