IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40837


Ignore:
Timestamp:
Jul 19, 2019, 5:32:31 PM (7 years ago)
Author:
eugene
Message:

do not allow splines with < 3 pts

Location:
branches/eam_branches/ohana.20190329/src/opihi/lib.data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ohana.20190329/src/opihi/lib.data/SplineOps.c

    r38441 r40837  
    4141    ALLOCATE (spline[0].y2, opihi_flt, spline[0].Nknots);
    4242  }
    43   memset (spline[0].xk, 0, spline[0].Nknots * sizeof(opihi_flt));
    44   memset (spline[0].yk, 0, spline[0].Nknots * sizeof(opihi_flt));
    45   memset (spline[0].y2, 0, spline[0].Nknots * sizeof(opihi_flt));
     43  if (spline[0].Nknots) {
     44    memset (spline[0].xk, 0, spline[0].Nknots * sizeof(opihi_flt));
     45    memset (spline[0].yk, 0, spline[0].Nknots * sizeof(opihi_flt));
     46    memset (spline[0].y2, 0, spline[0].Nknots * sizeof(opihi_flt));
     47  }
    4648}
    4749
  • branches/eam_branches/ohana.20190329/src/opihi/lib.data/spline.c

    r39231 r40837  
    77  float dy, dx, *tmp;
    88 
     9  // spline is not valid with < 3 points
     10  if (N < 3) return;
     11
    912  ALLOCATE (tmp, float, N);
    1013
     
    6972  opihi_flt dy, dx, *tmp;
    7073 
     74  // spline is not valid with < 3 points
     75  if (N < 3) return;
     76
    7177  ALLOCATE (tmp, opihi_flt, N);
    7278
Note: See TracChangeset for help on using the changeset viewer.