diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-13 12:12:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-13 21:11:08 +0100 |
commit | 35d57c1c8e5ad59b1fc43ff5f4a2bd5ff2542614 (patch) | |
tree | 1e96497efe6157db8894ef6a412d67156bac5cec | |
parent | tdf#129908 Crash at Data > Group and outlone > AutoOutline (diff) | |
download | core-35d57c1c8e5ad59b1fc43ff5f4a2bd5ff2542614.tar.gz core-35d57c1c8e5ad59b1fc43ff5f4a2bd5ff2542614.zip |
ofz#20051 if duplicate exists then m_ObjToRecMap points to deleted element
Change-Id: I854410ba1d5c0a622b5ba9c6816a24a3477e5089
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86686
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Jenkins
-rw-r--r-- | filter/source/msfilter/msdffimp.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index ca958de9a5ad..4c5b90780817 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -5105,8 +5105,13 @@ SvxMSDffImportRec* SvxMSDffImportData::find(const SdrObject* pObj) void SvxMSDffImportData::insert(std::unique_ptr<SvxMSDffImportRec> pImpRec) { - m_ObjToRecMap[pImpRec->pObj] = pImpRec.get(); - m_Records.insert(std::move(pImpRec)); + auto aRet = m_Records.insert(std::move(pImpRec)); + bool bSuccess = aRet.second; + if (bSuccess) + { + SvxMSDffImportRec* pRec = aRet.first->get(); + m_ObjToRecMap[pRec->pObj] = pRec; + } } void SvxMSDffImportData::NotifyFreeObj(SdrObject* pObj) |