diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-01-16 16:09:58 +0100 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-01-16 22:54:11 +0100 |
commit | 65c4b6d70a5e7eebb94db52f0389590bbf715827 (patch) | |
tree | ca3b268e5054ea8b5a8af887493f383bda09429a /include | |
parent | 6fc537cdf496f3a644ec68d6103de51eb7f5c9cb (diff) |
A base B3DTuple can no longer stand in for a derived BColor
...after 925c05ee1a1259641a28fe43588f425aff06b95e "chart2: Make automatic area
coloring for charts work for tiled rendering" added a non-static data member
BColor::bAutomatic.
And e.g. CppunitTest_basegfx started to fail with
> ==2962908==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f67a04a8378 at pc 0x56434b3e7077 bp 0x7ffdf41d8220 sp 0x7ffdf41d79e0
> READ of size 32 at 0x7f67a04a8378 thread T0
> #0 in __asan_memcpy at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:63:3
> #1 in basegfx::BColorModifier_black_and_white::getModifiedColor(basegfx::BColor const&) const at basegfx/source/color/bcolormodifier.cxx:318:20
> 0x7f67a04a8378 is located 0 bytes after global variable 'basegfx::B3DTuple::getEmptyTuple()::singleton' defined in 'basegfx/source/tuple/b3dtuple.cxx' (0x7f67a04a8360) of size 24
Change-Id: Ib1ec52ae388b213b10ad8a772a36b2158df8b003
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162179
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/basegfx/color/bcolor.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx index 584f9572e585..46a656b2307e 100644 --- a/include/basegfx/color/bcolor.hxx +++ b/include/basegfx/color/bcolor.hxx @@ -171,7 +171,8 @@ namespace basegfx static const BColor& getEmptyBColor() { - return static_cast<const BColor&>( ::basegfx::B3DTuple::getEmptyTuple() ); + static BColor const singleton; + return singleton; } }; |