Fix for #79704: G__exception in LHC10h pass 2
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Oct 2011 12:26:32 +0000 (12:26 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 11 Oct 2011 12:26:32 +0000 (12:26 +0000)
TPC/AliTPCtrackerSector.cxx

index 95d7fe9..1010851 100644 (file)
@@ -93,8 +93,10 @@ AliTPCtrackerRow::InsertCluster(const AliTPCclusterMI* c, UInt_t index) {
 
   if (fN==0) {fIndex[0]=index; fClusters[fN++]=c; return;}
   Int_t i=Find(c->GetZ());
-  memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
-  memmove(fIndex   +i+1 ,fIndex   +i,(fN-i)*sizeof(UInt_t));
+  if (i>=0 && i<=kMaxClusterPerRow-2) {
+    memmove(fClusters+i+1 ,fClusters+i,(fN-i)*sizeof(AliTPCclusterMI*));
+    memmove(fIndex   +i+1 ,fIndex   +i,(fN-i)*sizeof(UInt_t));
+  }
   fIndex[i]=index; fClusters[i]=c; fN++;
 }