diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-17 20:39:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-18 10:56:24 +0200 |
commit | e031303dc72560ca8aa0ad99e632ec25372628ea (patch) | |
tree | 6b6130c0842443e02ad89949f690c37c820b9c1a /sc | |
parent | 2e649291ef4146131eb0dd5592258f11cf9184e6 (diff) |
cid#1448339 Use after free
Change-Id: I3259e0fe9ebaba819d529af2fdb003ce9a297961
Reviewed-on: https://gerrit.libreoffice.org/75813
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/drawfunc/fuins1.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index dbd403fe0573..11e2290d08ff 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -198,12 +198,12 @@ static void lcl_InsertGraphic( const Graphic& rGraphic, // don't select if from (dispatch) API, to allow subsequent cell operations SdrInsertFlags nInsOptions = bApi ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE; - pView->InsertObjectAtView( pObj, *pPV, nInsOptions ); + bool bSuccess = pView->InsertObjectAtView( pObj, *pPV, nInsOptions ); // SetGraphicLink has to be used after inserting the object, // otherwise an empty graphic is swapped in and the contact stuff crashes. // See #i37444#. - if ( bAsLink ) + if (bSuccess && bAsLink) pObj->SetGraphicLink( rFileName, ""/*TODO?*/, rFilterName ); } |