From 5385086fef245b8debfb6d3bc40372af1d6d047b Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 13 Jul 2018 15:11:57 +0300 Subject: [PATCH] core: solve(): add check for passed 'method' values --- modules/core/src/lapack.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/src/lapack.cpp b/modules/core/src/lapack.cpp index 2ec808a7a6..95abe71288 100644 --- a/modules/core/src/lapack.cpp +++ b/modules/core/src/lapack.cpp @@ -1100,6 +1100,9 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth CV_Assert( type == _src2.type() && (type == CV_32F || type == CV_64F) ); method &= ~DECOMP_NORMAL; + CV_Check(method, method == DECOMP_LU || method == DECOMP_SVD || method == DECOMP_EIG || + method == DECOMP_CHOLESKY || method == DECOMP_QR, + "Unsupported method, see #DecompTypes"); CV_Assert( (method != DECOMP_LU && method != DECOMP_CHOLESKY) || is_normal || src.rows == src.cols );