Skip to content

Commit

Permalink
Merge pull request #39618 from fwyzard/fix_ECAL_GPU_unpacking_overflow
Browse files Browse the repository at this point in the history
Fix overflow in ECAL GPU unpacking [12.5.x]
  • Loading branch information
cmsbuild authored Oct 7, 2022
2 parents ee48ddc + 77f22f1 commit 56d567e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EventFilter/EcalRawToDigi/plugins/UnpackGPU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace ecal {
const uint64_t mask =
0xC0001000D0000000 + (uint64_t(TOWER_L1_MASK) << TOWER_L1_B) + (uint64_t(TOWER_BX_MASK) << TOWER_BX_B);

while (next_tower_block != trailer) {
while (next_tower_block < trailer) {
if ((*next_tower_block & mask) == sign) {
current_tower_block = next_tower_block;
return uint8_t(*next_tower_block & TOWER_ID_MASK);
Expand Down Expand Up @@ -232,7 +232,7 @@ namespace ecal {
auto const* current_tower_block = tower_blocks_start;
uint8_t iCh = 0;
uint8_t next_tower_id = exp_ttids[iCh];
while (current_tower_block != trailer && iCh < numbChannels) {
while (current_tower_block < trailer && iCh < numbChannels) {
auto const w = *current_tower_block;
uint8_t ttid = w & TOWER_ID_MASK;
uint16_t bxlocal = (w >> TOWER_BX_B) & TOWER_BX_MASK;
Expand Down

0 comments on commit 56d567e

Please sign in to comment.