IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 25, 2021, 5:04:15 PM (5 years ago)
Author:
eugene
Message:

add some asserts to trap memory overflow

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-dev-20210817/psModules/src/detrend/pmPattern.c

    r41859 r41861  
    418418          for (int x = 0; x < numCols; x++) {
    419419            image->data.F32[y][x] += solution->data.F32[y];
    420             psTrace("pattern",5,"B: %d %d %g\n",x,y,solution->data.F32[x]);
     420            psTrace("pattern",5,"B: %d %d %g\n",x,y,solution->data.F32[y]);
    421421          }
    422422          corr->data.F64[y][0]  -= solution->data.F32[y];
     
    444444          for (int x = 0; x < numCols; x++) {
    445445            image->data.F32[y][x] += solution->data.F32[y] * indices->data.F32[x];
    446             psTrace("pattern",5,"C: %d %d %g %g\n",x,y,solution->data.F32[x],indices->data.F32[x]);
     446            // XXX EAM : this was [x] which is wrong
     447            psTrace("pattern",5,"C: %d %d %g %g\n",x,y,solution->data.F32[y],indices->data.F32[x]);
    447448          }
    448449          corr->data.F64[y][1]  -= solution->data.F32[y] ;
     
    703704        }
    704705
     706        psAssert (solution->n == numCols, "oops");
    705707        for (int x = 0; x < numCols; x++) {
    706708            image->data.F32[y][x] -= solution->data.F32[x];
     
    747749        }
    748750      } else {
     751        psAssert (solution->n == numRows, "oops");
    749752        for (int y = 0; y < numRows; y++) {
    750753          for (int x = 0; x < numCols; x++) {
    751754            image->data.F32[y][x] += solution->data.F32[y];
    752             psTrace("pattern",5,"B: %d %d %g\n",x,y,solution->data.F32[x]);
     755            // XXX EAM : this was [x], which is wrong
     756            psTrace("pattern",5,"B: %d %d %g\n",x,y,solution->data.F32[y]);
    753757          }
    754758          corr->data.F64[y][0]  -= solution->data.F32[y];
     
    771775        psErrorClear();
    772776      } else {
     777        psAssert (solution->n == numRows, "oops");
    773778        for (int y = 0; y < numRows; y++) {
    774779          for (int x = 0; x < numCols; x++) {
    775780            image->data.F32[y][x] += solution->data.F32[y] * indices->data.F32[x];
    776             psTrace("pattern",5,"C: %d %d %g %g\n",x,y,solution->data.F32[x],indices->data.F32[x]);
     781            // XXX EAM : this was set to [x] which is wrong (numCols > numRows)
     782            psTrace("pattern",5,"C: %d %d %g %g\n",x,y,solution->data.F32[y],indices->data.F32[x]);
    777783          }
    778784          corr->data.F64[y][1]  -= solution->data.F32[y] ;
Note: See TracChangeset for help on using the changeset viewer.