chart2/source/tools/ReferenceSizeProvider.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 9aa52c452596db522cd9db616d98b03fe87c74d0 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Sun Feb 23 08:24:25 2025 -0500 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 24 09:29:07 2025 +0100 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> diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx index b1ca0b429a7b..37432c05fd53 100644 --- a/chart2/source/tools/ReferenceSizeProvider.cxx +++ b/chart2/source/tools/ReferenceSizeProvider.cxx @@ -226,7 +226,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