Skip to content

Commit

Permalink
BUG: check matrix vector length before accessing an element
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed Mar 15, 2022
1 parent 1f07e37 commit d2d22bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/rtkProjectionGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down

0 comments on commit d2d22bb

Please sign in to comment.