]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Important bugfix which affects the raw data events written without the common data...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 May 2006 15:59:33 +0000 (15:59 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 16 May 2006 15:59:33 +0000 (15:59 +0000)
RAW/AliRawReaderRoot.cxx

index 5d9dc16d61c46049cf0d6e6c612b8ee2aa8eabd5..a32bafc508cd08aa4ddfdf5e649dc45de748c033 100644 (file)
@@ -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;
       }
     }
   };