IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 4, 2004, 3:03:11 PM (22 years ago)
Author:
evanalst
Message:

Fix psImageFitPolynomial to check input argument validity.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/image/psImageStats.c

    r1939 r1951  
    1010*  @author George Gusciora, MHPCC
    1111*
    12 *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2004-09-30 23:06:36 $
     12*  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2004-10-05 01:03:11 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    236236        over all pixels (x,y) in the image.
    237237 *****************************************************************************/
    238 psPolynomial2D* psImageFitPolynomial(const psImage* input, psPolynomial2D* coeffs)
     238psPolynomial2D* psImageFitPolynomial(psPolynomial2D* coeffs, const psImage* input)
    239239{
    240240    int x = 0;
     
    247247    float *cScalingFactors = NULL;
    248248    float *rScalingFactors = NULL;
     249
     250    // Check for null inputs
     251    if (input == NULL) {
     252        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFitPolynomial",
     253                   PS_ERR_BAD_PARAMETER_NULL, true,
     254                   PS_ERRORTEXT_psImage_IMAGE_NULL);
     255        return NULL;
     256    }
     257
     258    if (coeffs == NULL) {
     259        psErrorMsg(PS_ERRORNAME_DOMAIN "psImageFitPolynomial",
     260                   PS_ERR_BAD_PARAMETER_NULL, true,
     261                   PS_ERRORTEXT_psImage_COEFF_NULL);
     262        return NULL;
     263    }
    249264
    250265    // Create the sums[][] data structure.  This
Note: See TracChangeset for help on using the changeset viewer.