From 77f22f1f9627f677b441e2bdfa09f898f8d555b9 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Wed, 5 Oct 2022 01:32:21 +0200 Subject: [PATCH] Fix overflow in ECAL GPU unpacking --- EventFilter/EcalRawToDigi/plugins/UnpackGPU.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EventFilter/EcalRawToDigi/plugins/UnpackGPU.cu b/EventFilter/EcalRawToDigi/plugins/UnpackGPU.cu index 9a9ac14d259a4..14255b6823b93 100644 --- a/EventFilter/EcalRawToDigi/plugins/UnpackGPU.cu +++ b/EventFilter/EcalRawToDigi/plugins/UnpackGPU.cu @@ -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); @@ -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;