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

(3.4) Fixed several issues found by static analysis

original commit: a079c2eb7c
This commit is contained in:
Maksim Shabunin
2021-12-15 12:49:13 +03:00
committed by Alexander Alekhin
parent 6a889ed3e5
commit 792b7e0629
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -1821,7 +1821,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);