From 00ece34fb7916b18053273e54fbe746170570d34 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 18 Jul 2019 12:04:21 +0100 Subject: cid#1448319 Use after free MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I45a4ea5c21707606b8853bb775a7d9eec595b88c Reviewed-on: https://gerrit.libreoffice.org/75912 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sd/source/ui/view/sdview4.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sd/source/ui/view/sdview4.cxx') 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(new SdIMapInfo(*pImageMap))); } } -- cgit