Ticket #3705 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Index out of range in VizGeorefSpline2D function.

Reported by: mloskot Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

The for loop in file thinplatespline.h:74 has 3 static iterations:

     for ( int i = 0; i < 3; i++ )
                rhs[i][v] = 0.0;

and with rhs being defined as

#define VIZGEOREF_MAX_VARS 2
double *rhs[VIZGEOREF_MAX_VARS];

leads to index out of range.

Change History

Changed 3 years ago by rouault

  • status changed from new to closed
  • resolution set to fixed

r20193 /trunk/gdal/alg/thinplatespline.h: Fix index out of range in thinplatespline.h (no bad effect was seen previously since rhs and coef should generally be packed one after the other one by the compiler) (#3705)

I completely removed the loop since grow_points() already takes care of zero'ing with VSICalloc. I also fixed the dump_data_points() which was inverting the order of the indices too (this function is unused)

Note: See TracTickets for help on using tickets.