Commit 31a22c27 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #14836 from alalek:static_analysis_issues_3.4

parents d8c5bd92 95d9cfb5
...@@ -2324,6 +2324,8 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2, ...@@ -2324,6 +2324,8 @@ void cvStereoRectify( const CvMat* _cameraMatrix1, const CvMat* _cameraMatrix2,
double c = _t[idx], nt = cvNorm(&t, 0, CV_L2); double c = _t[idx], nt = cvNorm(&t, 0, CV_L2);
_uu[idx] = c > 0 ? 1 : -1; _uu[idx] = c > 0 ? 1 : -1;
CV_Assert(nt > 0.0);
// calculate global Z rotation // calculate global Z rotation
cvCrossProduct(&t,&uu,&ww); cvCrossProduct(&t,&uu,&ww);
double nw = cvNorm(&ww, 0, CV_L2); double nw = cvNorm(&ww, 0, CV_L2);
......
...@@ -33,6 +33,7 @@ public: ...@@ -33,6 +33,7 @@ public:
BatchNormLayerImpl(const LayerParams& params) BatchNormLayerImpl(const LayerParams& params)
: dims(-1)
{ {
setParamsFrom(params); setParamsFrom(params);
CV_Assert(blobs.size() >= 2); CV_Assert(blobs.size() >= 2);
......
...@@ -147,6 +147,7 @@ public: ...@@ -147,6 +147,7 @@ public:
UMat &inpMat = inputs[inpIdx]; UMat &inpMat = inputs[inpIdx];
UMat &outMat = outputs[inpIdx]; UMat &outMat = outputs[inpIdx];
int newRows = total(shape(inpMat), 0, splitDim); int newRows = total(shape(inpMat), 0, splitDim);
CV_Assert(newRows != 0);
MatShape s = shape(newRows, inpMat.total() / newRows); MatShape s = shape(newRows, inpMat.total() / newRows);
UMat meanMat = UMat(s[0], 1, (use_half) ? CV_16S : CV_32F); UMat meanMat = UMat(s[0], 1, (use_half) ? CV_16S : CV_32F);
...@@ -221,6 +222,7 @@ public: ...@@ -221,6 +222,7 @@ public:
UMat &inpMat = inputs[inpIdx]; UMat &inpMat = inputs[inpIdx];
UMat &outMat = outputs[inpIdx]; UMat &outMat = outputs[inpIdx];
int newRows = total(shape(inpMat), 0, splitDim); int newRows = total(shape(inpMat), 0, splitDim);
CV_Assert(newRows != 0);
MatShape s = shape(newRows, inpMat.total() / newRows); MatShape s = shape(newRows, inpMat.total() / newRows);
UMat oneMat = UMat::ones(s[1], 1, CV_32F); UMat oneMat = UMat::ones(s[1], 1, CV_32F);
......
...@@ -138,6 +138,7 @@ static void computeShapeByReshapeMask(const MatShape &srcShape, ...@@ -138,6 +138,7 @@ static void computeShapeByReshapeMask(const MatShape &srcShape,
size_t srcTotal = total(srcShape); size_t srcTotal = total(srcShape);
size_t dstTotal = total(dstShape); size_t dstTotal = total(dstShape);
CV_Assert(dstTotal != 0);
if (inferDim != -1) if (inferDim != -1)
{ {
......
...@@ -162,6 +162,8 @@ void runLayer(LayerParams& params, const std::vector<Mat>& inputs, ...@@ -162,6 +162,8 @@ void runLayer(LayerParams& params, const std::vector<Mat>& inputs,
std::vector<Mat>& outputs) std::vector<Mat>& outputs)
{ {
Ptr<Layer> layer = LayerFactory::createLayerInstance(params.type, params); Ptr<Layer> layer = LayerFactory::createLayerInstance(params.type, params);
CV_Assert((bool)layer);
std::vector<MatShape> inpShapes(inputs.size()); std::vector<MatShape> inpShapes(inputs.size());
int ddepth = CV_32F; int ddepth = CV_32F;
for (size_t i = 0; i < inputs.size(); ++i) for (size_t i = 0; i < inputs.size(); ++i)
......
...@@ -30,7 +30,7 @@ inline mfxU32 codecIdByFourCC(int fourcc) ...@@ -30,7 +30,7 @@ inline mfxU32 codecIdByFourCC(int fourcc)
} }
VideoWriter_IntelMFX::VideoWriter_IntelMFX(const String &filename, int _fourcc, double fps, Size frameSize_, bool) VideoWriter_IntelMFX::VideoWriter_IntelMFX(const String &filename, int _fourcc, double fps, Size frameSize_, bool)
: session(0), plugin(0), deviceHandler(0), bs(0), encoder(0), pool(0), frameSize(frameSize_), good(false) : session(0), plugin(0), deviceHandler(0), bs(0), encoder(0), pool(0), outSurface(NULL), frameSize(frameSize_), good(false)
{ {
mfxStatus res = MFX_ERR_NONE; mfxStatus res = MFX_ERR_NONE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment