From 70b75198d9f8958e13b5688a382150830a210399 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Tue, 18 May 2010 17:43:09 +0000 Subject: [PATCH] Remove crash for case when all geographies are on the outer edges of the histobox, causing all to be classified as "deviants" by the stdev code line (#474) git-svn-id: http://svn.osgeo.org/postgis/trunk@5625 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/geography_estimate.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/postgis/geography_estimate.c b/postgis/geography_estimate.c index ab0bc76b4..d09334a34 100644 --- a/postgis/geography_estimate.c +++ b/postgis/geography_estimate.c @@ -1041,6 +1041,13 @@ compute_geography_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, } } + /* If everything was a deviant, the new histobox is the same as the old histobox */ + if ( ! newhistobox ) + { + newhistobox = palloc(sizeof(GBOX)); + memcpy(newhistobox, &histobox, sizeof(GBOX)); + } + /* * Set histogram extent as the intersection between * standard deviation based histogram extent -- 2.40.0