summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-23 20:47:00 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2020-08-27 16:36:56 +0200
commit804187175a0fafb9f763c09786ab4db857614049 (patch)
treea697632d7d9513ed832074ffcff5acfd9a812434
parentb622cf8907788ec1a0dd343b167b6188b1073cde (diff)
ofz#25169 insertion into set might find a duplicate
in which case pImpRec is deleted and pImpRecTmp is invalid Change-Id: I2a273a436ebd88cb53e329bbcb4f171dda6ed840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101156 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sw/source/filter/ww8/ww8par.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 054b0a98e9ee..b733cad8ce83 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1082,7 +1082,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
if( pImpRec->nShapeId )
{
- auto pImpRecTmp = pImpRec.get();
+ auto nShapeId = pImpRec->nShapeId;
+ auto nShapeOrder = (static_cast<sal_uLong>(pImpRec->aTextId.nTxBxS) << 16)
+ + pImpRec->aTextId.nSequence;
// Complement Import Record List
pImpRec->pObj = pObj;
rImportData.insert(std::move(pImpRec));
@@ -1094,9 +1096,9 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
( (rObjData.nSpFlags & ShapeFlag::Group)
&& (rObjData.nCalledByGroup < 2) )
)
- StoreShapeOrder( pImpRecTmp->nShapeId,
- ( static_cast<sal_uLong>(pImpRecTmp->aTextId.nTxBxS) << 16 )
- + pImpRecTmp->aTextId.nSequence, pObj );
+ {
+ StoreShapeOrder(nShapeId, nShapeOrder, pObj);
+ }
}
else
pImpRec.reset();