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/pmPatternIO.c

    r41856 r41861  
    531531        for (int i = 0; i < model->n; i++) {
    532532            psMetadata *row = model->data[i];
     533            psAssert (row, "missing model row");
    533534
    534535            char *cellName = psMetadataLookupStr(&status, row, "CELL_NAME");
     
    538539
    539540            int cellNumber = pmChipFindCell (chip, cellName);
     541            psAssert ((cellNumber >=0) && (cellNumber < chip->cells->n), "invalid cell number");
     542
    540543            pmCell *cell = chip->cells->data[cellNumber];
    541544            if (!cell) continue;
     545
     546            psAssert (cell->analysis, "oops");
    542547
    543548            psMetadataAddF32 (cell->analysis, PS_LIST_TAIL, "PTN.ROW.AMP", PS_META_REPLACE, "", amplitude);
Note: See TracChangeset for help on using the changeset viewer.