From 63464754ef747e0c3d16c5da6fd4d4228ab8dd7a Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 18 Feb 2015 11:29:54 +0100 Subject: Add an internal assertion in makeCompressed to catch a possible risk of null-pointer access. --- Eigen/src/SparseCore/SparseMatrix.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Eigen/src/SparseCore/SparseMatrix.h') diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 4c8965802..4562f3df9 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -467,6 +467,8 @@ class SparseMatrix if(isCompressed()) return; + eigen_internal_assert(m_outerIndex!=0 && m_outerSize>0); + Index oldStart = m_outerIndex[1]; m_outerIndex[1] = m_innerNonZeros[0]; for(Index j=1; j