diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-09-21 12:14:19 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2015-09-23 10:48:07 +0000 |
commit | b477a8d5df518cd8c30a1a21e3ffccc8bac88084 (patch) | |
tree | dbc1907ec4bd37d81bd51bd12969bdc6bf150fac /sw | |
parent | a6a46e2100f954085550f4dc6a597fd7ee234671 (diff) |
don't hang on busted subdocument offsets
Change-Id: I5d1d18f864496ec98894703f0a22e211a9dd14a5
(cherry picked from commit a2b90cd04733c2ec3b9cb3bb56d95f3298571ecc)
Reviewed-on: https://gerrit.libreoffice.org/18748
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/data/ww8/pass/hang-9.doc | bin | 0 -> 18944 bytes | |||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 12 |
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 Binary files differnew file mode 100644 index 000000000000..4e9e4120f4d7 --- /dev/null +++ b/sw/qa/core/data/ww8/pass/hang-9.doc diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index c8afe5285b2f..2c2a46b8da4c 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -4431,11 +4431,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; } } |