Commit 5b84e3fc authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by Jesse Mapel
Browse files

added isis error when GenericTransform::calculateInverse gets empty matrix (#3195)

parent 5911bac9
Loading
Loading
Loading
Loading
+34 −29
Original line number Diff line number Diff line
@@ -148,6 +148,11 @@ void GenericTransform::setInverse(const cv::Mat &matrix) {

/** Calculate the inverse transform from the forward matrix */
cv::Mat GenericTransform::calculateInverse(const cv::Mat &matrix) {
  if (matrix.empty()) {  // inverting an empty matrix causes a segfault
    QString msg = "Can't invert empty matrix.";
    throw IException(IException::Programmer, msg, _FILEINFO_);
  }

  return ( matrix.inv() );
}