Ticket #2300 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

Thin Plate Spline Initialization Error

Reported by: warmerdam Assigned to: warmerdam
Priority: high Milestone: 1.4.5
Component: GDAL_Raster Version: svn-trunk
Severity: major Keywords: tps thinplatespline
Cc:

Description

In some circumstances I was getting erroneous results from the gdaltransform commandline program when using the thin plate spline algorithm. Review with valgrind indicated use of uninitialized values which I traced to rhs[0][2] in alg/thinplatespline.cpp.

A careful review of the lifespan of rhs[] seems to indicate that values rhs[][0-2] are never actually set, but are used when evaluating equations.

A modification to VizGeorefSpline?2D::grow_points() to initialize these values to zero seemed to correct the results and fix the uninitialized memory error. I *suspect* that rhs used to be guaranteed initialized to zero (perhaps using new) but this was lost in the conversion to use VSIMalloc(). I have not tried to confirm this with a deeper analysis.

I *suspect* this is at the core of our very unreliable thin plate spline results.

Change History

03/29/08 23:39:47 changed by warmerdam

  • priority changed from normal to high.
  • status changed from new to closed.
  • resolution set to fixed.
  • severity changed from normal to major.

Patch applied in trunk (r14117), 1.5 (r14118) and 1.4 (r14119) branches.

I'm closing, but comments indicating if this resolves older TPS stability problems would be appreciated.