include/basegfx/color/bcolor.hxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 65c4b6d70a5e7eebb94db52f0389590bbf715827
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Tue Jan 16 16:09:58 2024 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Tue Jan 16 22:54:11 2024 +0100

    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 <[email protected]>

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;
         }
 
     };

Reply via email to