diff --git a/idlib/geometry/Surface_Polytope.cpp b/idlib/geometry/Surface_Polytope.cpp index 87a344c..3fc91d6 100644 --- a/idlib/geometry/Surface_Polytope.cpp +++ b/idlib/geometry/Surface_Polytope.cpp @@ -62,7 +62,7 @@ void idSurface_Polytope::FromPlanes( const idPlane *planes, const int numPlanes } for ( j = 0; j < w.GetNumPoints(); j++ ) { - for ( k = 0; k < verts.Num(); j++ ) { + for ( k = 0; k < verts.Num(); k++ ) { if ( verts[k].xyz.Compare( w[j].ToVec3(), POLYTOPE_VERTEX_EPSILON ) ) { break; } diff --git a/idlib/math/Matrix.cpp b/idlib/math/Matrix.cpp index b013764..f723ee9 100644 --- a/idlib/math/Matrix.cpp +++ b/idlib/math/Matrix.cpp @@ -3125,9 +3125,9 @@ bool idMatX::IsOrthonormal( const float epsilon ) const { ptr2 = mat + i; sum = ptr2[0] * ptr2[0] - 1.0f; - for ( i = 1; i < numRows; i++ ) { + for ( int j = 1; j < numRows; j++ ) { ptr2 += numColumns; - sum += ptr2[i] * ptr2[i]; + sum += ptr2[i] * ptr2[j]; } if ( idMath::Fabs( sum ) > epsilon ) { return false;