diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-13 10:22:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-13 10:26:54 +0100 |
commit | 93b65a7bf07aedd042f38e6417753e88b397992c (patch) | |
tree | 88b9f31c156dedb7d782a9fb54b5e343ca5023e6 | |
parent | 591dfe338ee2e553f822e8bbd3bc602a8ff0d875 (diff) |
guard against endpos preceeding startpos
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 88af9799bf..b0a2912ffe 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -3345,8 +3345,14 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p) if (nSmallest <= nLimitFC) { - p->nEndPos = nCpEnd - + WW8_CP nEndPos = nCpEnd - (nLimitFC-nSmallest) / (bIsUnicode ? 2 : 1); + + OSL_ENSURE(nEndPos >= p->nStartPos, "EndPos before StartPos"); + + if (nEndPos >= p->nStartPos) + p->nEndPos = nEndPos; + break; } } |