diff --git a/source/D3DXMatrix.cpp b/source/D3DXMatrix.cpp index f05d4ff..a030b6c 100644 --- a/source/D3DXMatrix.cpp +++ b/source/D3DXMatrix.cpp @@ -1,5 +1,6 @@ #include #include +#include // D3DX Matrix functions implemented in the means of DirectXMath @@ -12,7 +13,7 @@ D3DXMATRIX* WINAPI D3DXMatrixInverse_XM(D3DXMATRIX *pOut, FLOAT *pDeterminant, C const float det = XMVectorGetX(determinant); // Mirror the behaviour of D3DXMatrixInverse - if (det == 0.0f) + if (det == 0.0f || !std::isfinite(1.0f / det)) { return nullptr; }