Fixes for invalid write, detected by valgrind
authorhristov <Peter.Hristov@cern.ch>
Tue, 29 Jul 2014 19:10:44 +0000 (21:10 +0200)
committerhristov <Peter.Hristov@cern.ch>
Tue, 29 Jul 2014 19:10:44 +0000 (21:10 +0200)
ITS/AliITSTPArrayFit.cxx
TRD/AliTRDCalibraFillHisto.cxx

index 9f40b2b..fa132ef 100644 (file)
@@ -967,7 +967,7 @@ Bool_t AliITSTPArrayFit::FitHelixCrude(Int_t extQ)
   //
   const float *x=fkPoints->GetX(),*y=fkPoints->GetY(),*z=fkPoints->GetZ(),*cov=fkPoints->GetCov();
   //
-  if (fPntLast>arrU.GetSize()) {
+  if (fPntLast>=arrU.GetSize()) {
     arrU.Set(2*fPntLast);
     arrV.Set(2*fPntLast);
     arrW.Set(2*fPntLast);
index e3ce45a..45d0238 100644 (file)
@@ -1691,8 +1691,10 @@ Float_t AliTRDCalibraFillHisto::StoreInfoCHPHtrack(const AliTRDcluster *cl,const
 
   // Fill the fPHPlace and value
   if (fPH2dOn) {
-    fPHPlace[time] = group[1];
-    fPHValue[time] = charge;
+    if (time>=0 && time<fTimeMax) {
+      fPHPlace[time] = group[1];
+      fPHValue[time] = charge;
+    }
   }
 
   return correction;