#2300 closed defect (fixed)
Thin Plate Spline Initialization Error
Reported by: | warmerdam | Owned by: | 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 VizGeorefSpline2D::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 (2)
comment:1 by , 16 years ago
Priority: | normal → high |
---|---|
Resolution: | → fixed |
Severity: | normal → major |
Status: | new → closed |
comment:2 by , 15 years ago
This seems to have had a positive effect on bug #864.
i.e. I get segfaults with gdalwarp 1.5.0, but not with the latest SVN/trunk.
hooray!
thanks, Hamish
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.