]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Additional protection (Ivana)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Oct 2009 19:06:34 +0000 (19:06 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 13 Oct 2009 19:06:34 +0000 (19:06 +0000)
MUON/AliMUONCalibParamNF.cxx

index 600ed1396d92e1356059859b6e3dea8f354f0693..72f332d1ba7223a7c1f72bdca982a9f74112ba14 100644 (file)
@@ -23,6 +23,8 @@
 #include "TMath.h"
 #include "TString.h"
 
+#include <limits.h>
+
 //-----------------------------------------------------------------------------
 /// \class AliMUONCalibParamNF
 ///
@@ -280,6 +282,13 @@ AliMUONCalibParamNF::ValueAsInt(Int_t i, Int_t j) const
 /// Return the value as an int, by rounding the internal float value.
 
   Float_t v = ValueAsFloat(i,j);
+  
+  if ( v >= Float_t(INT_MAX) ) {
+    AliErrorStream() 
+      << "Cannot convert value " << v << " to Int_t." << endl;
+    return 0;
+  }  
+  
   return TMath::Nint(v);
 }