Skip to content

Commit

Permalink
fix uninitialized alpha on update color algorithms
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Nov 29, 2023
1 parent 8ff1257 commit 32805f5
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions vcg/complex/algorithms/update/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ class UpdateColor
class ColorAvgInfo
{
public:
unsigned int r;
unsigned int g;
unsigned int b;
unsigned int a;
int cnt;
unsigned int r = 0;
unsigned int g = 0;
unsigned int b = 0;
unsigned int a = 0;
int cnt = 0;
};

/*! \brief This function colors all (or the selected) the vertices of a mesh.
Expand Down Expand Up @@ -139,7 +139,6 @@ class UpdateColor
RequirePerVertexColor(m);

ColorAvgInfo csi;
csi.r = csi.g = csi.b = csi.cnt = 0;
SimpleTempData<typename MeshType::VertContainer, ColorAvgInfo> TD(m.vert, csi);

ForEachTetra(m, [&] (TetraType & t) {
Expand Down Expand Up @@ -172,7 +171,6 @@ class UpdateColor
RequirePerVertexColor(m);

ColorAvgInfo csi;
csi.r=0; csi.g=0; csi.b=0; csi.cnt=0;
SimpleTempData<typename MeshType::VertContainer, ColorAvgInfo> TD(m.vert,csi);

FaceIterator fi;
Expand Down

0 comments on commit 32805f5

Please sign in to comment.