sd/source/filter/eppt/pptx-animations-nodectx.cxx |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

New commits:
commit 2b43b2f3ed790914740680b6cd02af962526fc8d
Author:     Karthik Godha <[email protected]>
AuthorDate: Mon Dec 29 14:54:49 2025 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon Dec 29 15:40:39 2025 +0100

    ODP -> PPTX: Skip childTnLst for invalid audio
    
    childTnLst element can't be empty in PPTX export. For audio animations
    we are exporting childTnLst even if the audio is invalid
    
    bug document: tdf97809-1.odp
    
    Change-Id: I7f4e19cb6541453e36fee8c63d0877ad62896a52
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196279
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Stahl <[email protected]>

diff --git a/sd/source/filter/eppt/pptx-animations-nodectx.cxx 
b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
index 1fc049b6e42f..00a306345c58 100644
--- a/sd/source/filter/eppt/pptx-animations-nodectx.cxx
+++ b/sd/source/filter/eppt/pptx-animations-nodectx.cxx
@@ -23,6 +23,9 @@
 #include <com/sun/star/presentation/ParagraphTarget.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 
+#include <comphelper/storagehelper.hxx>
+#include <comphelper/processfactory.hxx>
+
 #include <o3tl/any.hxx>
 #include <o3tl/string_view.hxx>
 
@@ -35,6 +38,7 @@ using namespace ::com::sun::star::drawing;
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::presentation;
 using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::io;
 
 namespace oox::core
 {
@@ -177,6 +181,23 @@ void NodeContext::initValid(bool bHasValidChild, bool 
bIsIterateChild)
             if (xAudio->getSource() >>= sURL)
             {
                 mbValid = IsAudioURL(sURL);
+
+                // Check whether URL is accessible
+                try
+                {
+                    if (!sURL.startsWith("vnd.sun.star.Package:"))
+                    {
+                        Reference<XInputStream> xAudioStream;
+                        xAudioStream = 
comphelper::OStorageHelper::GetInputStreamFromURL(
+                            sURL, comphelper::getProcessComponentContext());
+                        mbValid = mbValid && xAudioStream.is();
+                    }
+                }
+                catch (const Exception&)
+                {
+                    SAL_WARN("sd", "NodeContext::initValid, invalid audio");
+                    mbValid = false;
+                }
             }
             else if (xAudio->getSource() >>= xShape)
             {

Reply via email to