diff --git a/include/rtkProjectionGeometry.h b/include/rtkProjectionGeometry.h index 9956fc611..14d99a5b9 100644 --- a/include/rtkProjectionGeometry.h +++ b/include/rtkProjectionGeometry.h @@ -77,6 +77,10 @@ class ITK_TEMPLATE_EXPORT ProjectionGeometry : public itk::DataObject MatrixType GetMatrix(const unsigned int i) const { + if (i >= this->m_Matrices.size()) + { + itkExceptionMacro(<< "Requested matrix index " << i << " is out of bound."); + } return this->m_Matrices[i]; }