svtools/source/misc/embedhlp.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 2469e69af85bb5fa03f38f85801f4cdda29e5f54
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Fri Sep 20 13:47:06 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Fri Sep 20 13:23:59 2024 +0200

    Make sure to have a graphic here
    
    Commit 8872f7121b4ae4dd0b51820366d3510a88f7aac2 (crashtesting: crash
    on exporting kde274105-6.docx to .rtf, 2024-03-27) made sure to provide
    a graphic in all cases, to avoid crashes revealed by crashtesting.
    In commit f317746f55044927a180657f81e21d662102b0c5, I removed that.
    This reinstates the safety measure for cases when there's no graphic
    yet.
    
    Change-Id: Ida3eecd5c7ccff087c2ca8b6076ca01b8a145adc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173697
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 63f1e366a945..9e14fb5d37a8 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -477,6 +477,10 @@ void EmbeddedObjectRef::GetReplacement( bool bUpdate )
         return;
     }
 
+    // Missing graphic can crash
+    if (!mpImpl->oGraphic)
+        mpImpl->oGraphic.emplace();
+
     std::unique_ptr<SvStream> pGraphicStream(GetGraphicStream( bUpdate ));
     if (!pGraphicStream && aOldGraphic.IsNone())
     {

Reply via email to