bug fix: 8 words were read outside the data buffer
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 May 2011 09:11:13 +0000 (09:11 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 25 May 2011 09:11:13 +0000 (09:11 +0000)
HLT/TPCLib/AliHLTTPCHWClusterTransformComponent.cxx

index 81c1bbd..be9ae0d 100644 (file)
@@ -30,6 +30,7 @@ using namespace std;
 #include "AliHLTTPCTransform.h"
 #include "AliHLTTPCSpacePointData.h"
 #include "AliHLTTPCClusterDataFormat.h"
+#include "AliRawDataHeader.h"
 
 #include "AliCDBManager.h"
 #include "AliCDBEntry.h"
@@ -219,12 +220,13 @@ int AliHLTTPCHWClusterTransformComponent::DoEvent(const AliHLTComponentEventData
      
      // skip the first 8 32-bit CDH words
      buffer += 8;
+     UInt_t bufferSize32 = ((Int_t)iter->fSize - sizeof(AliRawDataHeader) )/sizeof(AliHLTUInt32_t);
 
      //PrintDebug(buffer, (Int_t)iter->fSize/sizeof(AliHLTUInt32_t));
 
      unsigned long nAddedClusters = 0;
      
-     for(UInt_t nWords=0; nWords<(iter->fSize/sizeof(AliHLTUInt32_t)); nWords+=5){
+     for(UInt_t nWords=0; nWords<bufferSize32; nWords+=5){
      //     for(UInt_t nWords=0; nWords<5; nWords+=5){
 
        // check if bit 31 and 30 of the 32-bit word is 11 -> cluster (10 is RCU trailer)