diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-26 13:21:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-13 17:35:27 +0200 |
commit | 5a0b6f5ba8506de648ab72ef320445a49ba4c67d (patch) | |
tree | 48dcce718124be5496b0977f3dae4323bf79ba85 /sw | |
parent | 5ac25ec1fd3b2537171e1e679f7e9e9a50c45f9c (diff) |
ofz#2392 restored props don't match saved props
Change-Id: Idb198f0121ac9c6b4083b157af07c5eb1cda66cb
Reviewed-on: https://gerrit.libreoffice.org/39265
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 2804d0a76625..1c6463df7b6c 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -5331,8 +5331,19 @@ void WW8PLCFxDesc::Restore( const WW8PLCFxSave1& rSave ) pPLCFx->GetSprms(&aD); pPLCFx->SetDirty(false); aD.ReduceByOffset(); - pMemPos = aD.pMemPos + rSave.nPLCFxMemOfs; - nSprmsLen = nOrigSprmsLen - rSave.nPLCFxMemOfs; + + if (nOrigSprmsLen > aD.nSprmsLen) + { + //two entries exist for the same offset, cut and run + SAL_WARN("sw.ww8", "restored properties don't match saved properties, bailing out"); + nSprmsLen = 0; + pMemPos = nullptr; + } + else + { + nSprmsLen = nOrigSprmsLen - rSave.nPLCFxMemOfs; + pMemPos = aD.pMemPos + rSave.nPLCFxMemOfs; + } } } } |