diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-18 12:04:21 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-19 09:39:55 +0200 |
commit | 00ece34fb7916b18053273e54fbe746170570d34 (patch) | |
tree | 11bc1bce98a679ebcacc18dec9b3d512b984a186 /sd | |
parent | 7ec75e04da4b7ada7ba120fbc5a30f6d5152cc85 (diff) |
cid#1448319 Use after free
Change-Id: I45a4ea5c21707606b8853bb775a7d9eec595b88c
Reviewed-on: https://gerrit.libreoffice.org/75912
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index cb50639b2593..93d88afb7028 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -270,9 +270,10 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, } else { - InsertObjectAtView(pNewGrafObj, *pPV, nOptions); - - if( pImageMap ) + bool bSuccess = InsertObjectAtView(pNewGrafObj, *pPV, nOptions); + if (!bSuccess) + pNewGrafObj = nullptr; + else if (pImageMap) pNewGrafObj->AppendUserData(std::unique_ptr<SdrObjUserData>(new SdIMapInfo(*pImageMap))); } } |