sc/source/filter/excel/xepage.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
New commits: commit 014fffe23d68e6187d8eb6b0e94b310c60384ddf Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Sun Feb 23 09:06:31 2025 -0500 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Apr 9 17:58:50 2025 +0200 sc: filter: check for null Brush The likely cause of the this crash: /opt/collaboraoffice/program/libmergedlo.so( SvxBrushItem::GetGraphicObject(rtl::OUString const&) const+0x25)[0x7faf881f90e5] /opt/collaboraoffice/program/libmergedlo.so( SvxBrushItem::GetGraphic(rtl::OUString const&) const+0xd)[0x7faf881f964d] /opt/collaboraoffice/program/libscfiltlo.so(+0x1b1dbe)[0x7faf7a32fdbe] /opt/collaboraoffice/program/libscfiltlo.so(+0x107371)[0x7faf7a285371] This was fixed by identifying all the GetGraphic() calls on a pointer. This turned out to be the only unprotected one in sc/source/filter, where the stack shows. Signed-off-by: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Change-Id: I64175e838423dfeaa4f93762c4894a99236a2ece Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182073 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit 3e146b4c8dcc15bb12ef036162090a0301d6aadf) (cherry picked from commit 0d6eefe77ed1b1ac9798f3ad9a215892cce33409) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183922 Tested-by: Jenkins (cherry picked from commit 4241af29fad1aba278286d7cbc0a2942eb189cc4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183933 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx index 28779bd209a1..06af615d0e56 100644 --- a/sc/source/filter/excel/xepage.cxx +++ b/sc/source/filter/excel/xepage.cxx @@ -489,8 +489,9 @@ void XclExpPageSettings::SaveXml( XclExpXmlStream& rStrm ) XclExpImgData* XclExpPageSettings::getGraphicExport() { - if( const Graphic* pGraphic = maData.mxBrushItem->GetGraphic() ) - return new XclExpImgData( *pGraphic, EXC_ID8_IMGDATA ); + if( maData.mxBrushItem ) + if( const Graphic* pGraphic = maData.mxBrushItem->GetGraphic() ) + return new XclExpImgData( *pGraphic, EXC_ID8_IMGDATA ); return nullptr; }