summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-21 12:14:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-09-21 13:57:16 +0100
commita2b90cd04733c2ec3b9cb3bb56d95f3298571ecc (patch)
treea050cb770917c0b15edba9c5e45311cafcde0677
parent951dbdd13100f92fb3ded20fd8d14ca645c4af37 (diff)
don't hang on busted subdocument offsets
Change-Id: I5d1d18f864496ec98894703f0a22e211a9dd14a5
-rw-r--r--sw/qa/core/data/ww8/pass/hang-9.docbin0 -> 18944 bytes
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx12
2 files changed, 8 insertions, 4 deletions
diff --git a/sw/qa/core/data/ww8/pass/hang-9.doc b/sw/qa/core/data/ww8/pass/hang-9.doc
new file mode 100644
index 000000000000..4e9e4120f4d7
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/hang-9.doc
Binary files differ
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 683b29696c03..35848d884fff 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -4409,11 +4409,15 @@ void WW8PLCFxDesc::ReduceByOffset()
else
nStartPos -= nCpOfs;
}
- if( nEndPos != WW8_CP_MAX )
+ if (nEndPos != WW8_CP_MAX)
{
- OSL_ENSURE(nCpOfs <= nEndPos,
- "oh oh, so much for the subdocument piece theory");
- nEndPos -= nCpOfs;
+ if (nCpOfs > nEndPos)
+ {
+ SAL_WARN("sw.ww8", "broken subdocument piece entry");
+ nEndPos = WW8_CP_MAX;
+ }
+ else
+ nEndPos -= nCpOfs;
}
}