[Libreoffice-commits] .: sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Jul 13 02:27:39 PDT 2011
sw/source/filter/ww8/ww8scan.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 93b65a7bf07aedd042f38e6417753e88b397992c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jul 13 10:22:02 2011 +0100
guard against endpos preceeding startpos
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 88af979..b0a2912 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;
}
}
More information about the Libreoffice-commits
mailing list