IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17625


Ignore:
Timestamp:
May 9, 2008, 4:51:25 PM (18 years ago)
Author:
Paul Price
Message:

Adding trap against SEGV.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackLoop.c

    r17426 r17625  
    478478                                             subKernels->data[i]); // Pixels to reject
    479479            psFree(inspect);
    480             float frac = reject->n / (float)(outRO->image->numCols * outRO->image->numRows); // Pixel fraction
    481             psTrace("ppStack", 5, "%ld pixels rejected from image %d (%.1f%%)", reject->n, i, frac * 100.0);
    482             if (frac > imageRej) {
    483                 psWarning("Image %d rejected completely because rejection fraction (%.3f) "
    484                           "exceeds limit (%.3f)", i, frac, imageRej);
    485                 psFree(reject);
    486                 // reject == NULL means reject image completely
    487                 reject = NULL;
     480            if (!reject) {
     481                psWarning("Rejection on image %d didn't work --- reject entire image.", i);
    488482                numRejected++;
     483            } else {
     484                float frac = reject->n / (float)(outRO->image->numCols * outRO->image->numRows); // Pixel frac
     485                psTrace("ppStack", 5, "%ld pixels rejected from image %d (%.1f%%)",
     486                        reject->n, i, frac * 100.0);
     487                if (frac > imageRej) {
     488                    psWarning("Image %d rejected completely because rejection fraction (%.3f) "
     489                              "exceeds limit (%.3f)", i, frac, imageRej);
     490                    psFree(reject);
     491                    // reject == NULL means reject image completely
     492                    reject = NULL;
     493                    numRejected++;
     494                }
    489495            }
    490496            rejected->data[i] = reject;
Note: See TracChangeset for help on using the changeset viewer.