Skip to content

Commit b05e616

Browse files
afursshahor02
authored andcommitted
FIT hotfix: fix for protection against single event header within data block
1 parent cbd02b0 commit b05e616

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Detectors/FIT/raw/include/FITRaw/RawReaderBase.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,17 @@ class RawReaderBase
6464
auto& refDataBlock = vecDataBlocks.emplace_back();
6565
refDataBlock.decodeBlock(binaryPayload, srcPos);
6666
srcPos += refDataBlock.mSize;
67+
if (refDataBlock.mSize == 16) {
68+
//exclude data block in case of single header(no data, total size == 16 bytes)
69+
vecDataBlocks.pop_back();
70+
continue;
71+
}
6772
if (!refDataBlock.isCorrect()) {
6873
LOG(warning) << "INCORRECT DATA BLOCK! Byte position: " << srcPos - refDataBlock.mSize << " | Payload size: " << binaryPayload.size() << " | DataBlock size: " << refDataBlock.mSize;
6974
refDataBlock.print();
7075
vecDataBlocks.pop_back();
7176
return srcPos;
7277
}
73-
if (refDataBlock.getNgbtWords() == 0) {
74-
vecDataBlocks.pop_back();
75-
continue;
76-
}
7778
}
7879
return srcPos;
7980
}

0 commit comments

Comments
 (0)