From 9627a3363180a43da6093c35a8110b3e79cde2db Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 1 Aug 2014 18:43:59 +0000 Subject: [PATCH] #2845, Bad geometry created from ST_AddPoint git-svn-id: http://svn.osgeo.org/postgis/trunk@12849 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 1 + liblwgeom/lwline.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index b59c50e2f..c4bb01558 100644 --- a/NEWS +++ b/NEWS @@ -92,6 +92,7 @@ PostGIS 2.2.0 - #2803, ST_MapAlgebra handles no userarg and STRICT callback function - #2822, Use @ operator instead of ST_CoveredBy() for raster max extent constraint + - #2845, Bad geometry created from ST_AddPoint * Code refactoring * diff --git a/liblwgeom/lwline.c b/liblwgeom/lwline.c index f10ef7c84..1f5da5ebe 100644 --- a/liblwgeom/lwline.c +++ b/liblwgeom/lwline.c @@ -313,7 +313,15 @@ lwline_add_lwpoint(LWLINE *line, LWPOINT *point, int where) { POINT4D pt; getPoint4d_p(point->point, 0, &pt); - return ptarray_insert_point(line->points, &pt, where); + + if ( ptarray_insert_point(line->points, &pt, where) != LW_SUCCESS ) + return LW_FAILURE; + + /* Update the bounding box */ + lwgeom_drop_bbox(lwline_as_lwgeom(line)); + lwgeom_drop_bbox(lwline_as_lwgeom(line)); + + return LW_SUCCESS; } -- 2.49.0