summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-18 12:06:20 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-19 11:14:26 +0200
commit4959b71cbc91dbe2c454d1d7bf2092c01c4f0cae (patch)
treee0ce42b99a581f4218c2ce28e1f86db79af61ce6
parent7988e38a1b627b92a69dd11eabc495ff180df34d (diff)
cid#1448351 Use after free
Change-Id: I5591303096a495565e4e3638ca8db8196fa26092 Reviewed-on: https://gerrit.libreoffice.org/75913 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index c062c0c8f936..21a541285cc1 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -347,9 +347,9 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
aName,
aRect);
SdrPageView* pPV = pView->GetSdrPageView();
- pView->InsertObjectAtView(pObj, *pPV);
+ bool bSuccess = pView->InsertObjectAtView(pObj, *pPV);
- if ( nAspect != embed::Aspects::MSOLE_ICON )
+ if (bSuccess && nAspect != embed::Aspects::MSOLE_ICON)
{
// Math objects change their object size during InsertObject.
// New size must be set in SdrObject, or a wrong scale will be set at
@@ -380,7 +380,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
// Object selected, activate Draw-Shell
rViewShell.SetDrawShell( true );
}
- else
+ else if (bSuccess)
{
rViewShell.ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW);
}