Merge pull request #24211 from philsc:fix-asan-crash

Fix "use after free" issue in `essential_solver.cpp`
pull/24228/head
Alexander Smorkalov 1 year ago committed by GitHub
commit 91808e64a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      modules/calib3d/src/usac/essential_solver.cpp

@ -239,7 +239,8 @@ public:
// (5) Compute the left eigenvectors of the action matrix // (5) Compute the left eigenvectors of the action matrix
Eigen::EigenSolver<Eigen::Matrix<double, 10, 10>> eigensolver(action_mat_eig); Eigen::EigenSolver<Eigen::Matrix<double, 10, 10>> eigensolver(action_mat_eig);
const Eigen::VectorXcd &eigenvalues = eigensolver.eigenvalues(); const Eigen::VectorXcd &eigenvalues = eigensolver.eigenvalues();
const auto * const eig_vecs_ = (double *) eigensolver.eigenvectors().real().data(); const Eigen::MatrixXcd eigenvectors = eigensolver.eigenvectors();
const auto * const eig_vecs_ = (double *) eigenvectors.data();
#else #else
Matx<double, 10, 10> A = constraint_mat.colRange(0, 10), Matx<double, 10, 10> A = constraint_mat.colRange(0, 10),
B = constraint_mat.colRange(10, 20), eliminated_mat; B = constraint_mat.colRange(10, 20), eliminated_mat;

Loading…
Cancel
Save