From b2321576bc0a651cd41a013dbbf074d7bda2918f Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Wed, 24 Feb 2021 20:31:00 +0300 Subject: [PATCH] Fixed several issues found by static analysis --- modules/calib3d/src/sqpnp.hpp | 1 + modules/dnn/src/layers/pooling_layer.cpp | 2 +- modules/videoio/src/cap_msmf.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/calib3d/src/sqpnp.hpp b/modules/calib3d/src/sqpnp.hpp index f8136324c9..97c10e34e7 100644 --- a/modules/calib3d/src/sqpnp.hpp +++ b/modules/calib3d/src/sqpnp.hpp @@ -72,6 +72,7 @@ private: cv::Matx r_hat; cv::Matx t; double sq_error; + SQPSolution() : sq_error(0) {} }; /* diff --git a/modules/dnn/src/layers/pooling_layer.cpp b/modules/dnn/src/layers/pooling_layer.cpp index 834493966f..ac25bf4dae 100644 --- a/modules/dnn/src/layers/pooling_layer.cpp +++ b/modules/dnn/src/layers/pooling_layer.cpp @@ -750,7 +750,7 @@ virtual Ptr initNgraph(const std::vector >& inp if (max_elem!=last) { dstData[x0] = *max_elem; - if( compMaxIdx ) + if( compMaxIdx && dstMaskData ) { dstMaskData[x0] = std::distance(first, max_elem); } diff --git a/modules/videoio/src/cap_msmf.cpp b/modules/videoio/src/cap_msmf.cpp index 7caa7c1ea0..fe3d261d34 100644 --- a/modules/videoio/src/cap_msmf.cpp +++ b/modules/videoio/src/cap_msmf.cpp @@ -309,7 +309,7 @@ class SourceReaderCB : public IMFSourceReaderCallback { public: SourceReaderCB() : - m_nRefCount(0), m_hEvent(CreateEvent(NULL, FALSE, FALSE, NULL)), m_bEOS(FALSE), m_hrStatus(S_OK), m_reader(NULL), m_dwStreamIndex(0) + m_nRefCount(0), m_hEvent(CreateEvent(NULL, FALSE, FALSE, NULL)), m_bEOS(FALSE), m_hrStatus(S_OK), m_reader(NULL), m_dwStreamIndex(0), m_lastSampleTimestamp(0) { }