IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 28, 2009, 11:21:56 AM (17 years ago)
Author:
eugene
Message:

always handle psVectorStats false return status (is an error); check for NAN results and handle as possible

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotDiagnosticPlots.c

    r21108 r23989  
    4040
    4141    psStats *stats = psStatsAlloc (PS_STAT_MAX | PS_STAT_MIN);
    42     psVectorStats (stats, values, NULL, NULL, 0);
     42    if (!psVectorStats (stats, values, NULL, NULL, 0)) {
     43        psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram");
     44        return false;
     45    }
    4346
    4447    psHistogram *histogram = psHistogramAlloc (stats->min, stats->max, 1000);
     
    6366    psStatsInit (stats);
    6467    stats->options = PS_STAT_MAX | PS_STAT_MIN;
    65     psVectorStats (stats, histogram->nums, NULL, NULL, 0);
     68    if (!psVectorStats (stats, histogram->nums, NULL, NULL, 0)) {
     69        psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram");
     70        return false;
     71    }
    6672
    6773    // scale the plot to hold the histogram
     
    100106    psStatsInit (stats);
    101107    stats->options = PS_STAT_MAX | PS_STAT_MIN;
    102     psVectorStats (stats, histogram->nums, NULL, NULL, 0);
     108    if (!psVectorStats (stats, histogram->nums, NULL, NULL, 0)) {
     109        psError(PS_ERR_UNKNOWN, false, "failure to measure stats for histogram");
     110        return false;
     111    }
    103112
    104113    // scale the plot to hold the histogram
Note: See TracChangeset for help on using the changeset viewer.