summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/ww8scan.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8/ww8scan.cxx')
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index d318522100cf..d64e207313d8 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -7179,8 +7179,16 @@ void WW8DopTypography::ReadFromMem(BYTE *&pData)
for (i=0; i < nMaxLeading; ++i)
rgxchLPunct[i] = Get_Short(pData);
- rgxchFPunct[cchFollowingPunct]=0;
- rgxchLPunct[cchLeadingPunct]=0;
+ if (cchFollowingPunct >= 0 && cchFollowingPunct < nMaxFollowing)
+ rgxchFPunct[cchFollowingPunct]=0;
+ else
+ rgxchFPunct[nMaxFollowing - 1]=0;
+
+ if (cchLeadingPunct >= 0 && cchLeadingPunct < nMaxLeading)
+ rgxchLPunct[cchLeadingPunct]=0;
+ else
+ rgxchLPunct[nMaxLeading - 1]=0;
+
}
void WW8DopTypography::WriteToMem(BYTE *&pData) const