Ticket #4278 (new defect)
VizGeorefSpline2D::solve result not checked
| Reported by: | yavorr | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Algorithms | Version: | 1.8.1 |
| Severity: | normal | Keywords: | thin plate spline |
| Cc: |
Description
The result of VizGeorefSpline?2D::solve is not checked in GDALCreateTPSTransformer.
If VizGeorefSpline?2D::solve fails the function still returns a not NULL result and the transformation becomes unpredictable.
The problem comes in solve:
// Invert the matrix
int status = matrixInvert( _nof_eqs, _AA, _Ainv );
if ( !status )
{
fprintf(stderr, " There is a problem to invert the interpolation matrix\n");
return 0;
}
while calculating matrixInvert:
ftemp = temp[ k*2*N + k ]; if ( ftemp == 0.0f ) // matrix cannot be inverted
I think there should be something like this in GDALCreateTPSTransformer:
if ( psInfo->poForward->solve() == 0 ||
psInfo->poReverse->solve() == 0 )
{
GDALDestroyTPSTransformer(psInfo);
return NULL;
}
Change History
Note: See
TracTickets for help on using
tickets.
