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

Merge pull request #25617 from Abdurrahheem:ash/01D-einsum-test

Fixed out-of-bound access in Einsum layer for 0d
This commit is contained in:
Alexander Smorkalov
2024-05-22 12:37:30 +03:00
committed by GitHub
+2 -2
View File
@@ -498,7 +498,7 @@ public:
} else {
// Check if there is a pre-processed version of this input
// If so assign it to result
if (!preProcessedInputs[0].empty())
if (!preProcessedInputs.empty() && !preProcessedInputs[0].empty())
{
result = preProcessedInputs[0];
}
@@ -541,7 +541,7 @@ public:
// Use either the preprocessed inputs (if it is available) or the corresponding raw inputs
result = pairwiseOperandProcess(!result.empty() ? result : rawInputs[0],
!result.empty() ? tmpResult : homogenizedInputDims[0],
!preProcessedInputs[input].empty() ? preProcessedInputs[input] : rawInputs[input],
(!preProcessedInputs.empty() && !preProcessedInputs[input].empty()) ? preProcessedInputs[input] : rawInputs[input],
homogenizedInputDims[input],
reducedDims,
isFinalPair);