Skip to content

Commit e3ba242

Browse files
committed
pidTPCModule.h: Fix access out of bounds
1 parent 476dce6 commit e3ba242

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Common/Tools/PID/pidTPCModule.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ typedef struct Str_dEdx_correction {
189189
for (int i = 0; i < fMatrix.GetNrows(); i++) {
190190
for (int j = 0; j < fMatrix.GetNcols(); j++) {
191191
double param = fMatrix(i, j);
192-
double value1 = i > static_cast<int>(vec1.size()) ? 0 : vec1[i];
193-
double value2 = j > static_cast<int>(vec2.size()) ? 0 : vec2[j];
192+
double value1 = i >= static_cast<int>(vec1.size()) ? 0 : vec1[i];
193+
double value2 = j >= static_cast<int>(vec2.size()) ? 0 : vec2[j];
194194
result += param * value1 * value2;
195195
}
196196
}

0 commit comments

Comments
 (0)