coverity fixes
authorrbertens <rbertens@cern.ch>
Wed, 14 Jan 2015 14:16:45 +0000 (15:16 +0100)
committerrbertens <rbertens@cern.ch>
Wed, 14 Jan 2015 14:17:36 +0000 (15:17 +0100)
PWG/FLOW/Tasks/AliAnalysisTaskFlowStrange.cxx
PWG/FLOW/Tasks/AliFlowTrackCuts.cxx

index 585f26a..6d5bbf6 100644 (file)
@@ -979,7 +979,10 @@ Int_t AliAnalysisTaskFlowStrange::GetReferenceMultiplicity() { //toberefined
   Int_t ref=0;
   for(Int_t id=0; id!=rawN; ++id) {
     track = dynamic_cast<AliAODTrack*>(tAOD->GetTrack(id));
-    if(!track) AliFatal("Not a standard AOD");
+    if(!track) {
+        AliFatal("Not a standard AOD");
+        continue;
+    }
     if(!track->TestFilterBit(fRFPFilterBit)) continue;
     ++ref;
   }
index 3a26302..ab0cec6 100644 (file)
@@ -188,7 +188,7 @@ AliFlowTrackCuts::AliFlowTrackCuts():
       fVZEROApol[i] = 0;
       fVZEROCpol[i] = 0;
   }
-  for(Int_t i(0); i < 8; i++){ fUseVZERORing[i] = kTRUE;}
+  for(Int_t i(0); i < 8; i++) fUseVZERORing[i] = kTRUE;
     
   for(int i=0;i<50;i++){
     fCutContour[i]= NULL;
@@ -314,7 +314,12 @@ AliFlowTrackCuts::AliFlowTrackCuts(const char* name):
       fVZEROCpol[i] = 0;
   }
   for(Int_t i(0); i < 8; i++) fUseVZERORing[i] = kTRUE;
+
+  for(int i=0;i<50;i++){
+    fCutContour[i]= NULL;
+    fCutGraph[i]=NULL;
   }
+}
 
 //-----------------------------------------------------------------------
 AliFlowTrackCuts::AliFlowTrackCuts(const AliFlowTrackCuts& that):
@@ -3679,7 +3684,7 @@ Bool_t AliFlowTrackCuts::PassesTPCTOFNsigmaCutPuritybased(const AliAODTrack* tra
     Int_t p_bin = -999;
     Double_t pBins[50];
     for(int b=0;b<50;b++){pBins[b] = 0.1*b;}
-    for(int i=0;i<50;i++){
+    for(int i=0;i<49;i++){      // fixed from <50 14012015 to avoid out-of-bounds RAB
         if(track->P()>pBins[i] && track->P()<(pBins[i+1])){
             p_bin = i;
         }