1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Fixed several issues found by static analysis

This commit is contained in:
Maksim Shabunin
2021-12-15 12:49:13 +03:00
committed by Maksim Shabunin
parent d8b1fc45aa
commit a079c2eb7c
5 changed files with 11 additions and 5 deletions
+3 -2
View File
@@ -238,7 +238,7 @@ public:
EltwiseInvoker(EltwiseLayerInt8Impl& self_)
: self(self_)
, nsrcs(0), dst(0), buf(0), nstripes(0), activ(0), channels(0)
, nsrcs(0), dst(0), buf(0), nstripes(0), activLUT(0), activ(0), channels(0)
, planeSize(0), offset(0)
{}
@@ -345,7 +345,8 @@ public:
int8_t* dstptr0 = dst->ptr<int8_t>();
float* bufptr0 = buf->ptr<float>();
int blockSize0 = 1 << 12;
CV_Assert(op != PROD || zeropointsptr);
CV_Assert((op != PROD && op != SUM) || coeffsptr);
for (size_t ofs = stripeStart; ofs < stripeEnd; )
{
int sampleIdx = (int)(ofs / planeSize);
+3 -1
View File
@@ -2023,7 +2023,9 @@ void ONNXImporter::parseUnsqueeze(LayerParams& layerParams, const opencv_onnx::N
}
CV_Assert(axes.getIntValue(axes.size()-1) <= dims.size());
for (int j = 0; j < axes.size(); j++) {
dims.insert(dims.begin() + axes.getIntValue(j), 1);
const int idx = axes.getIntValue(j);
CV_Assert(idx <= dims.size());
dims.insert(dims.begin() + idx, 1);
}
Mat out = input.reshape(0, dims);