IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 19, 2026, 5:03:35 PM (2 months ago)
Author:
eugene
Message:

free analysis and bias elements of pmReadout in FreeData, but reallocated if structure is reused

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-pstamp-20260421/psModules/src/camera/pmFPARead.c

    r42980 r43024  
    456456    // Get the list of overscans: only for IMAGE types (no overscan for MASK and VARIANCE)
    457457    if (type == FPA_READ_TYPE_IMAGE) {
     458        // prevent the segfault by testing for readout->bias to exist
     459        if (!readout->bias) {
     460            readout->bias = psListAlloc(NULL);
     461        }
     462        // why would we have a left-over entry on the bias array?
    458463        if (readout->bias->n != 0) {
    459464            // Make way!
     
    846851        }
    847852
     853        // XXX EAM: sometimes we arrive here with the array of readouts full
     854        // but missing critical pieces??
    848855        pmReadout *readout;             // Readout into which to read
    849856        if (cell->readouts->n > i && cell->readouts->data[i]) {
    850857            readout = psMemIncrRefCounter(cell->readouts->data[i]);
     858            // if we get to this point with a reused readout,
     859            // the analysis and bias entries will be NULL
     860            if (!readout->analysis) {
     861                readout->analysis = psMetadataAlloc();
     862            }
     863            if (!readout->bias) {
     864                readout->bias = psListAlloc(NULL);
     865            }
    851866        } else {
    852867            readout = pmReadoutAlloc(cell);
Note: See TracChangeset for help on using the changeset viewer.