IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 17, 2006, 5:38:08 AM (20 years ago)
Author:
rhl
Message:

If nData == 0 then Sums is null, and Sums[] is a SEGV

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psMinimizePolyFit.c

    r8245 r8408  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-08-09 02:26:44 $
     12 *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-08-17 15:38:08 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    20032003
    20042004    // Free the sums
    2005     for (int ix = 0; ix < 2*nXterm; ix++) {
    2006         for (int iy = 0; iy < 2*nYterm; iy++) {
    2007             for (int iz = 0; iz < 2*nZterm; iz++) {
    2008                 psFree(Sums[ix][iy][iz]);
    2009             }
    2010             psFree(Sums[ix][iy]);
    2011         }
    2012         psFree(Sums[ix]);
    2013     }
    2014     psFree(Sums);
    2015 
     2005    if (Sums == NULL) {
     2006        assert (nData == 0);
     2007    } else {
     2008        for (int ix = 0; ix < 2*nXterm; ix++) {
     2009            for (int iy = 0; iy < 2*nYterm; iy++) {
     2010                for (int iz = 0; iz < 2*nZterm; iz++) {
     2011                    psFree(Sums[ix][iy][iz]);
     2012                }
     2013                psFree(Sums[ix][iy]);
     2014            }
     2015            psFree(Sums[ix]);
     2016        }
     2017        psFree(Sums);
     2018    }
    20162019
    20172020    // XXX: rel10_ifa used psMatrixGJSolve().  However, this failed tests.  So, I'm using psMatrixLUD().
Note: See TracChangeset for help on using the changeset viewer.