From 7c726b9151fb86674512a12b1fe4e0135fdae646 Mon Sep 17 00:00:00 2001 From: cvetan Date: Tue, 16 May 2006 15:59:33 +0000 Subject: [PATCH] Important bugfix which affects the raw data events written without the common data header --- RAW/AliRawReaderRoot.cxx | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/RAW/AliRawReaderRoot.cxx b/RAW/AliRawReaderRoot.cxx index 5d9dc16d61c..a32bafc508c 100644 --- a/RAW/AliRawReaderRoot.cxx +++ b/RAW/AliRawReaderRoot.cxx @@ -369,23 +369,24 @@ Bool_t AliRawReaderRoot::ReadHeader() fPosition += sizeof(AliRawDataHeader); } - if (fHeader->fSize != 0xFFFFFFFF) { + if (fHeader && (fHeader->fSize != 0xFFFFFFFF)) { fCount = fHeader->fSize - sizeof(AliRawDataHeader); + + // check consistency of data size in the header and in the sub event + if (fPosition + fCount > fEnd) { + Error("ReadHeader", "size in data header exceeds event size!"); + Warning("ReadHeader", "skipping %d bytes", fEnd - fPosition); + fEquipment->GetEquipmentHeader()->Dump(); + fCount = 0; + fPosition = fEnd; + fErrorCode = kErrSize; + continue; + } + } else { fCount = fEnd - fPosition; } - // check consistency of data size in the header and in the sub event - if (fPosition + fCount > fEnd) { - Error("ReadHeader", "size in data header exceeds event size!"); - Warning("ReadHeader", "skipping %d bytes", fEnd - fPosition); - fEquipment->GetEquipmentHeader()->Dump(); - fCount = 0; - fPosition = fEnd; - fErrorCode = kErrSize; - continue; - } - } while (!IsSelected()); return kTRUE; @@ -525,9 +526,7 @@ Int_t AliRawReaderRoot::CheckData() const // check consistency of data size in the header and in the equipment AliRawDataHeader* header = (AliRawDataHeader*) position; if (header->fSize != 0xFFFFFFFF) { - if (position + header->fSize > end) { - result |= kErrSize; - } + if (position + header->fSize > end) result |= kErrSize; } } }; -- 2.43.5