ofz#566458134 Integer-overflow

vcl/source/outdev/ImplMapRes.cxx:190:23: runtime error: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'tools::Long' (aka 'long')
     #0 0x5afc86b89af9 in AbsoluteToLocalX vcl/source/outdev/ImplMapRes.cxx:190:23
     #1 0x5afc86b89af9 in ImplMapRes::TransformPointX(long, ImplMapRes const&) const vcl/source/outdev/ImplMapRes.cxx:214:21
     #2 0x5afc862abe28 in OutputDevice::LogicToLogic(Point const&, MapMode const*, MapMode const*) const vcl/source/outdev/map.cxx:991:32
     #3 0x5afc862ab0eb in OutputDevice::SetRelativeMapMode(MapMode const&) vcl/source/outdev/map.cxx:417:16
     #4 0x5afc85733670 in (anonymous namespace)::GraphicExporter::GetGraphic((anonymous namespace)::ExportSettings const&, Graphic&, bool) svx/source/unodraw/UnoGraphicExporter.cxx:909:19

when none of the shapes rendered for a SmartArt fallback has any
content the bound stays empty, and the metafile origin taken from
the minimum of that empty range rounds to LONG_MIN

so start an empty bound at 0,0

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I7f35f6280a882cd5c49de3e411bc0d006cdf9725
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13623
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 47dca3b9edf464297b1cef08a6223885d12efebf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211528
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2026-09-29 08:45:42 +02:00
committed by Xisco Fauli
parent e9801baf62
commit 954442e825
@@ -882,6 +882,10 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
}
}
// Shapes with no visible content anchor at 0,0
if (aBound.isEmpty())
aBound.expand(basegfx::B2DTuple(0, 0));
aOut->EnableOutput( false );
aOut->SetMapMode( aMap );
if( rSettings.mbUseHighContrast )