summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8b27a3fb24c4..c8c5a380ab9a 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -2550,11 +2550,12 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt,
of the new data
*/
bool bExpand = IsExpandableSprm(nSpId);
- const void* pEndAvailableData = maRawData + sizeof(maRawData);
- if ((IsReplaceAllSprm(nSpId) || bExpand) && aEntry.mpData + 2 + sizeof(sal_uInt32) <= pEndAvailableData)
+ const sal_uInt8* pStartData = aEntry.mpData + 2;
+ const sal_uInt8* pLastValidDataPos = maRawData + sizeof(maRawData) - sizeof(sal_uInt32);
+ if ((IsReplaceAllSprm(nSpId) || bExpand) && pStartData <= pLastValidDataPos)
{
sal_uInt32 nCurr = pDataSt->Tell();
- sal_uInt32 nPos = SVBT32ToUInt32(aEntry.mpData + 2);
+ sal_uInt32 nPos = SVBT32ToUInt32(pStartData);
sal_uInt16 nLen(0);
bool bOk = checkSeek(*pDataSt, nPos);