summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-06-12 19:50:23 +0200
committerPetr Mladek <pmladek@suse.cz>2012-06-26 12:37:06 +0200
commit6b989477dc3d4b1c3296f65e18028090669cf9f2 (patch)
tree81c35c88b23868b9be8d2fca50ec0b39b79f3448
parent6a6cee1af26e68c7a5479f2eff5a33d483ff54ed (diff)
Resolves: fdo#49178 CRASH when FILEOPEN particular RTF
(cherry picked from commit 104badf31c8a39994cadc460561bfa01e428b67b) Signed-off-by: Miklos Vajna <vmiklos@suse.cz> Signed-off-by: Caolán McNamara <caolanm@redhat.com> Signed-off-by: Petr Mladek <pmladek@suse.cz> Change-Id: Idd938980b91ec8b822a92dfd7013a20fe5b6f498
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index b4aaf3d9c179..7403b4289069 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -486,8 +486,9 @@ void DomainMapperTableManager::endOfRowAction()
sal_Int16 nSum = 0;
sal_uInt32 nPos = 0;
+ sal_uInt32 nSizeTableGrid = pTableGrid->size();
// Ignoring the i=0 case means we assume that the width of the last cell matches the table width
- for (int i = m_nCell; i > 1; i--)
+ for (sal_uInt32 i = m_nCell; i > 1 && nSizeTableGrid >= i; i--)
{
nSum += (*pTableGrid.get())[pTableGrid->size() - i]; // Size of the current cell
pSeparators[nPos].Position = nSum * nFullWidthRelative / nFullWidth; // Relative position