Commit dd07c28a authored by Paul Ramsey's avatar Paul Ramsey

Fix crasher found in garden tests


git-svn-id: http://svn.osgeo.org/postgis/trunk@13554 b70326c6-7e19-0410-871a-916f4a2858ee
parent 7c50f5c6
......@@ -1304,17 +1304,19 @@ ptarray_locate_point(const POINTARRAY *pa, const POINT4D *p4d, double *mindistou
if ( ! proj4d ) proj4d = &projtmp;
start = getPoint2d_cp(pa, 0);
/* If the pointarray has only one point, the nearest point is */
/* just that point */
if ( pa->npoints == 1 )
{
getPoint4d_p(pa, 0, proj4d);
*mindistout = distance2d_pt_pt(&p, start);
if ( mindistout )
*mindistout = distance2d_pt_pt(&p, start);
return 0.0;
}
/* Loop through pointarray looking for nearest segment */
start = getPoint2d_cp(pa, 0);
for (t=1; t<pa->npoints; t++)
{
double dist;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment