chart2/source/tools/ReferenceSizeProvider.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit e485c6caa5d53c4ad1e7286dacfa9cb5a071eb7e Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Sun Feb 23 08:24:25 2025 -0500 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Apr 9 17:02:45 2025 +0200 chart2: protect against null chart objects in ReferenceSizeProvider The likely cause of this crash: /opt/collaboraoffice/program/../program/libchartcorelo.so( chart::ReferenceSizeProvider::getAutoResizeState( rtl::Reference<chart::ChartModel> const&)+0x87)[0x7f98773> /opt/collaboraoffice/program/../program/libchartcorelo.so( chart::ReferenceSizeProvider::ReferenceSizeProvider( com::sun::star::awt::Size, rtl::Reference<chart::ChartModel> const&)+0x2c)[0x7> /opt/collaboraoffice/program/../program/libchartcontrollerlo.so(+0x1fc3ae)[0x7f98769e43ae] /opt/collaboraoffice/program/../program/libchartcontrollerlo.so(+0x1fd3b8)[0x7f98769e53b8] Although it's not entirely clear that, if the given chart is null, a subsequent access wouldn't seg-fault. Signed-off-by: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Change-Id: I16a39436c10adfca7f26e9304fd249efb0a53f8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182072 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 9aa52c452596db522cd9db616d98b03fe87c74d0) (cherry picked from commit ca4e0b62bd814ff1d4f2e707ff658dd4a63cb728) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183921 Tested-by: Jenkins (cherry picked from commit 52e6adcf470b0b186eaa8bb62c23a5d89648a266) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183934 Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com> diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx index 57c2015ad23b..6135724dca5d 100644 --- a/chart2/source/tools/ReferenceSizeProvider.cxx +++ b/chart2/source/tools/ReferenceSizeProvider.cxx @@ -224,7 +224,8 @@ ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState // Main Title if( xChartDoc.is()) impl_getAutoResizeFromTitled( xChartDoc, eResult ); - if( eResult == AUTO_RESIZE_AMBIGUOUS ) + if (eResult == AUTO_RESIZE_AMBIGUOUS + || eResult == AUTO_RESIZE_UNKNOWN) // Unknown when xChartDoc is null. return eResult; // diagram is needed by the rest of the objects