Skip to content

Commit

Permalink
Syntax fix which seems to be more than just 'syntax' as it also seems…
Browse files Browse the repository at this point in the history
… to avoid a freeze of the ICP algorithm...
  • Loading branch information
dgirardeau committed Sep 21, 2024
1 parent f332b81 commit 38355ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/SquareMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ namespace CCCoreLib
**/
void initFromQuaternion(const double q[])
{
if (m_matrixSize != 3)
if (m_matrixSize != 0 && m_matrixSize != 3)
{
invalidate();
}
Expand Down Expand Up @@ -803,7 +803,8 @@ namespace CCCoreLib
// matrix already initialized with the right size
return true;
}
else if (m_matrixSize != 0)

if (m_matrixSize != 0)
{
// matrix already initialized with the wrong size
invalidate();
Expand All @@ -812,18 +813,17 @@ namespace CCCoreLib

if (size == 0)
{
// nothing to do
return true;
}

m_values = new Scalar*[size];
m_values = new Scalar*[size]{};
if (nullptr == m_values)
{
// not enough memory
return false;
}

m_data = new Scalar[size * size];
m_data = new Scalar[size * size]{};
if (nullptr == m_data)
{
// not enough memory
Expand Down

0 comments on commit 38355ef

Please sign in to comment.