From: cvetan Date: Tue, 20 Nov 2007 11:24:31 +0000 (+0000) Subject: Fixes need in order to use the raw-reader in HLT (Jochen) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=76a7ad7aabdfaa11459bba98127d3538fb48c284;p=u%2Fmrichter%2FAliRoot.git Fixes need in order to use the raw-reader in HLT (Jochen) --- diff --git a/RAW/AliRawReaderMemory.cxx b/RAW/AliRawReaderMemory.cxx index 710368232f7..d8741c6ec94 100644 --- a/RAW/AliRawReaderMemory.cxx +++ b/RAW/AliRawReaderMemory.cxx @@ -82,7 +82,10 @@ Bool_t AliRawReaderMemory::ReadHeader() // Check that the header is sane, that is the size does not go past the buffer. // Otherwise try again at the next word location. - if (fHeader->fSize == 0 or fPosition+fCount+fHeader->fSize > fBufferSize) { + if ( ( (fHeader->fSize == 0) || + ((Int_t)fPosition + fCount + (Int_t)fHeader->fSize > (Int_t)fBufferSize ) ) + && fHeader->fSize != 0xFFFFFFFF) { + if (fPosition + sizeof(UInt_t) <= fBufferSize) { fPosition += sizeof(UInt_t); continue; @@ -97,7 +100,7 @@ Bool_t AliRawReaderMemory::ReadHeader() if (fHeader->fSize != 0xFFFFFFFF) { fCount = fHeader->fSize - sizeof(AliRawDataHeader); } else { - fCount = fBufferSize - fPosition - sizeof(AliRawDataHeader); + fCount = fBufferSize - sizeof(AliRawDataHeader); } } while (!IsSelected()); diff --git a/RAW/AliRawReaderMemory.h b/RAW/AliRawReaderMemory.h index f0c5ca1e2f1..40a82345f44 100644 --- a/RAW/AliRawReaderMemory.h +++ b/RAW/AliRawReaderMemory.h @@ -41,7 +41,7 @@ class AliRawReaderMemory: public AliRawReader { virtual UInt_t GetGDCId() const {return 0;}; virtual UInt_t GetTimestamp() const {return 0;}; - virtual Int_t GetEquipmentSize() const {return 0;}; + virtual Int_t GetEquipmentSize() const {return fBufferSize;}; virtual Int_t GetEquipmentType() const {return 0;}; virtual Int_t GetEquipmentId() const {return fEquipmentId;}; virtual const UInt_t* GetEquipmentAttributes() const {return NULL;}; @@ -77,3 +77,4 @@ class AliRawReaderMemory: public AliRawReader { }; #endif +