oox/source/ppt/slidefragmenthandler.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit e157146d6f4fae68bab3fc0275722f79f6db1480
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Fri Jul 18 09:06:56 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Aug 7 10:01:45 2025 +0200

    oox: fix crash in the SlideFragmentHandler dtor
    
    Crashreport signature:
    
    > terminate called after throwing an instance of 
'com::sun::star::uno::RuntimeException'
    > program/libmergedlo.so
    >       oox::ppt::SlideFragmentHandler::~SlideFragmentHandler() [clone 
.cold]
    >               oox/source/ppt/slidefragmenthandler.cxx:70
    > program/libmergedlo.so
    >       oox::ppt::SlideFragmentHandler::~SlideFragmentHandler()
    >               include/cppuhelper/weak.hxx:91
    > program/libmergedlo.so
    >       oox::ppt::PresentationFragmentHandler::importSlide(unsigned int, 
bool, bool)
    >               
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/shared_ptr_base.h:1070
    > program/libmergedlo.so
    >       oox::ppt::PresentationFragmentHandler::finalizeImport()
    >               oox/source/ppt/presentationfragmenthandler.cxx:645
    
    Aborting the entire PPTX import just because inserting some VML shapes
    failed sounds like going too far.
    
    Change-Id: Idfa1718185ac4716da5d5cbdb2bfe68f11badb9c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188036
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit adc6db837691d791c53ef1c4b05fcaaad79c158f)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188692
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/oox/source/ppt/slidefragmenthandler.cxx 
b/oox/source/ppt/slidefragmenthandler.cxx
index 64577409c0b1..ee87d752a65f 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -65,8 +65,15 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& 
rFilter, const OUStri
 
 SlideFragmentHandler::~SlideFragmentHandler()
 {
-    // convert and insert all VML shapes (mostly form controls)
-    mpSlidePersistPtr->getDrawing()->convertAndInsert();
+    try
+    {
+        // convert and insert all VML shapes (mostly form controls)
+        mpSlidePersistPtr->getDrawing()->convertAndInsert();
+    }
+    catch (const uno::Exception&)
+    {
+        TOOLS_WARN_EXCEPTION("oox", "SlideFragmentHandler dtor: VML shape 
insertion failed");
+    }
 }
 
 ::oox::core::ContextHandlerRef SlideFragmentHandler::onCreateContext( 
sal_Int32 aElementToken, const AttributeList& rAttribs )

Reply via email to