diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-06-26 13:21:49 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-06-27 14:02:17 +0200 |
commit | 18428f127a9c721c10a26e2303c3dc80fe4ee309 (patch) | |
tree | 1127d51666656a6fa7f4724513b2b08ff7803d83 | |
parent | 0407f4b518b437b0277c7a9d8246436675b1e6b1 (diff) |
ofz#2392 restored props don't match saved props
Change-Id: Idb198f0121ac9c6b4083b157af07c5eb1cda66cb
Reviewed-on: https://gerrit.libreoffice.org/39267
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit 63f5d076c1a79a125f01c140469fdf797bb7f120)
-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 a435d7ecbc5a..ec3dc11da85c 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -5337,8 +5337,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; + } } } } |