[Bf-blender-cvs] [14667de65bd] master: Fix uninitialized ColorSceneLinear4f occuring in certain situations.

Martijn Versteegh noreply at git.blender.org
Sat Dec 24 10:39:39 CET 2022


Commit: 14667de65bd139c13e1b19cc8a0621ab7147d7c2
Author: Martijn Versteegh
Date:   Fri Dec 23 12:01:59 2022 +0100
Branches: master
https://developer.blender.org/rB14667de65bd139c13e1b19cc8a0621ab7147d7c2

Fix uninitialized ColorSceneLinear4f occuring in certain situations.

On gcc 11.3, Ubuntu 22.04 the default constructor for
ColorSceneLinear4f did not zero the r,g,b,a member variables. Replacing
the empty constructor with a default constructor circumvents this
problem (compiler bug? ) even though it *should* be more or less
equivalent.

===================================================================

M	source/blender/blenlib/BLI_color.hh

===================================================================

diff --git a/source/blender/blenlib/BLI_color.hh b/source/blender/blenlib/BLI_color.hh
index b1b9aeb17f1..0256cec667c 100644
--- a/source/blender/blenlib/BLI_color.hh
+++ b/source/blender/blenlib/BLI_color.hh
@@ -152,9 +152,7 @@ BLI_INLINE ColorTheme4<uint8_t> BLI_color_convert_to_theme4b(const ColorTheme4<f
 template<eAlpha Alpha>
 class ColorSceneLinear4f final : public ColorRGBA<float, eSpace::SceneLinear, Alpha> {
  public:
-  constexpr ColorSceneLinear4f<Alpha>() : ColorRGBA<float, eSpace::SceneLinear, Alpha>()
-  {
-  }
+  constexpr ColorSceneLinear4f<Alpha>() = default;
 
   constexpr ColorSceneLinear4f<Alpha>(const float *rgba)
       : ColorRGBA<float, eSpace::SceneLinear, Alpha>(rgba)



More information about the Bf-blender-cvs mailing list