summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-11 20:58:22 +0100
committerDavid Tardon <dtardon@redhat.com>2015-08-12 08:02:28 +0000
commit806eb2861e2417f9ab4121565f5f857bc86144ca (patch)
tree29bbb81d4de4997f1492701373810b1a54e34183
parente1e524f33f121c4084e96d1f85911a3e68cb8c6c (diff)
avoid another hang with certain .docs
(cherry picked from commit 0592da19b625975886d3442477f4399660736a69) Change-Id: If16e90c5ba1a43ceb9702e752835928da7b3ef32 Reviewed-on: https://gerrit.libreoffice.org/17657 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r--sw/qa/core/data/ww8/pass/hang-3.docbin0 -> 10240 bytes
-rw-r--r--sw/source/filter/ww8/ww8par.cxx4
2 files changed, 2 insertions, 2 deletions
diff --git a/sw/qa/core/data/ww8/pass/hang-3.doc b/sw/qa/core/data/ww8/pass/hang-3.doc
new file mode 100644
index 000000000000..4188b801a45b
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/hang-3.doc
Binary files differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index e3e4aaad8402..0f8f8d5aa5bc 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2286,7 +2286,7 @@ void SwWW8ImplReader::Read_HdFtText(WW8_CP nStart, WW8_CP nLen, SwFrameFormat* p
bool SwWW8ImplReader::isValid_HdFt_CP(WW8_CP nHeaderCP) const
{
// Each CP of Plcfhdd MUST be less than FibRgLw97.ccpHdd
- return (nHeaderCP < m_pWwFib->ccpHdr);
+ return (nHeaderCP < m_pWwFib->ccpHdr && nHeaderCP >= 0);
}
bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIhdt,
@@ -2304,7 +2304,7 @@ bool SwWW8ImplReader::HasOwnHeaderFooter(sal_uInt8 nWhichItems, sal_uInt8 grpfIh
{
bool bOk = true;
if( m_bVer67 )
- bOk = ( m_pHdFt->GetTextPos(grpfIhdt, nI, start, nLen ) && nLen >= 2 );
+ bOk = ( m_pHdFt->GetTextPos(grpfIhdt, nI, start, nLen ) && start >= 0 && nLen >= 2 );
else
{
m_pHdFt->GetTextPosExact( static_cast< short >(nNumber + (nSect+1)*6), start, nLen);