Fix issues found by static analysis

pull/18770/head
Maksim Shabunin 4 years ago
parent e12adcdf08
commit 1b0dca9c2c
  1. 4
      modules/calib3d/src/usac/ransac_solvers.cpp
  2. 4
      modules/core/src/dxt.cpp
  3. 2
      modules/gapi/include/opencv2/gapi/render/render_types.hpp
  4. 3
      modules/objdetect/src/qrcode.cpp

@ -286,7 +286,7 @@ public:
current_score = quality->getScore(models[i]); current_score = quality->getScore(models[i]);
} else { } else {
if (is_magsac && iters % repeat_magsac == 0) { if (is_magsac && iters % repeat_magsac == 0) {
if (!local_optimization->refineModel if (local_optimization && !local_optimization->refineModel
(models[i], best_score_thread, models[i], current_score)) (models[i], best_score_thread, models[i], current_score))
continue; continue;
} else if (model_verifier->isModelGood(models[i])) { } else if (model_verifier->isModelGood(models[i])) {
@ -1028,4 +1028,4 @@ bool run (const Ptr<const Model> &params, InputArray points1, InputArray points2
} }
return false; return false;
} }
}} }}

@ -531,14 +531,14 @@ template<typename T> struct DFT_R5
template<typename T> struct DFT_VecR2 template<typename T> struct DFT_VecR2
{ {
void operator()(Complex<T>* dst, const int c_n, const int n, const int dw0, const Complex<T>* wave) const { void operator()(Complex<T>* dst, const int c_n, const int n, const int dw0, const Complex<T>* wave) const {
return DFT_R2<T>()(dst, c_n, n, dw0, wave); DFT_R2<T>()(dst, c_n, n, dw0, wave);
} }
}; };
template<typename T> struct DFT_VecR3 template<typename T> struct DFT_VecR3
{ {
void operator()(Complex<T>* dst, const int c_n, const int n, const int dw0, const Complex<T>* wave) const { void operator()(Complex<T>* dst, const int c_n, const int n, const int dw0, const Complex<T>* wave) const {
return DFT_R3<T>()(dst, c_n, n, dw0, wave); DFT_R3<T>()(dst, c_n, n, dw0, wave);
} }
}; };

@ -252,7 +252,7 @@ struct Mosaic
{ {
} }
Mosaic() = default; Mosaic() : cellSz(0), decim(0) {}
/*@{*/ /*@{*/
cv::Rect mos; //!< Coordinates of the mosaic cv::Rect mos; //!< Coordinates of the mosaic

@ -1122,7 +1122,7 @@ bool QRDecode::computeClosestPoints(const vector<Point> &result_integer_hull)
{ {
CV_TRACE_FUNCTION(); CV_TRACE_FUNCTION();
double min_norm, max_norm = 0.0; double min_norm, max_norm = 0.0;
size_t idx_min; size_t idx_min = (size_t)-1;
for (size_t i = 0; i < original_points.size(); i++) for (size_t i = 0; i < original_points.size(); i++)
{ {
min_norm = std::numeric_limits<double>::max(); min_norm = std::numeric_limits<double>::max();
@ -1144,6 +1144,7 @@ bool QRDecode::computeClosestPoints(const vector<Point> &result_integer_hull)
max_norm = min_norm; max_norm = min_norm;
unstable_pair = std::pair<size_t,Point>(i, closest_pnt); unstable_pair = std::pair<size_t,Point>(i, closest_pnt);
} }
CV_Assert(idx_min != (size_t)-1);
closest_points.push_back(std::pair<size_t,Point>(idx_min, closest_pnt)); closest_points.push_back(std::pair<size_t,Point>(idx_min, closest_pnt));
} }

Loading…
Cancel
Save