]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALCalibTimeDepCorrection.cxx
coverity corrections
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALCalibTimeDepCorrection.cxx
index e87ea54610af329e1270afcbbfd09837aa909b62..9f210ea2171b0cec85d92df2013886ff74d95200 100644 (file)
@@ -122,7 +122,7 @@ void AliEMCALCalibTimeDepCorrection::ReadTextInfo(Int_t nSM, const TString &txtF
     AliEMCALSuperModuleCalibTimeDepCorrection * t = (AliEMCALSuperModuleCalibTimeDepCorrection*) fSuperModuleData[i];
 
     if (!inputFile) {
-      printf("AliEMCALCalibTimeDepCorrection::ReadTextInfo - Error while reading input file; likely EOF..");
+      printf("AliEMCALCalibTimeDepCorrection::ReadTextInfo - Error while reading input file; likely EOF..\n");
       return;
     }
     inputFile >> iSM;
@@ -131,6 +131,13 @@ void AliEMCALCalibTimeDepCorrection::ReadTextInfo(Int_t nSM, const TString &txtF
     for (Int_t j=0; j<nAPDPerSM; j++) {
       inputFile >> iCol >> iRow >> nCorr;
 
+      // check that input values are not out bounds
+      if (iCol<0 || iCol>(AliEMCALGeoParams::fgkEMCALCols-1) ||
+         iRow<0 || iRow>(AliEMCALGeoParams::fgkEMCALRows-1) ) {
+       printf("AliEMCALCalibTimeDepCorrection::ReadTextInfo - Error while reading input file; j %d iCol %d iRow %d\n", j, iCol, iRow);
+      return;
+      }
+
       // assume that this info is already swapped and done for this basis?
       if (swapSides) {
        // C side, oriented differently than A side: swap is requested