Skip to content

Commit e31bd4d

Browse files
fweigdavidrohr
authored andcommitted
GPUTPCClusterFinder: Add protection against Out-Of-Bounds read in PeakFinder.
1 parent 3f9b8d7 commit e31bd4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

GPU/GPUTracking/TPCClusterFinder/GPUTPCCFPeakFinder.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ GPUd() void GPUTPCCFPeakFinder::findPeaksImpl(int32_t nBlocks, int32_t nThreads,
108108
CfChargePos pos = positions[CAMath::Min<SizeT>(idx, digitnum - 1)];
109109
Charge charge = pos.valid() ? chargeMap[pos].unpack() : Charge(0);
110110

111-
bool hasLostBaseline = padHasLostBaseline[pos.gpad];
111+
bool hasLostBaseline = pos.valid() ? padHasLostBaseline[pos.gpad] : true;
112112
charge = hasLostBaseline ? 0.f : charge;
113113

114114
uint8_t peak = isPeak(smem, charge, pos, SCRATCH_PAD_SEARCH_N, chargeMap, calib, smem.posBcast, smem.buf);

0 commit comments

Comments
 (0)