From 296871a1ff7cd151d67bb6ba5019b201f2d534d3 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Thu, 14 Sep 2017 22:57:54 +0000 Subject: [PATCH] #3731, backend crash on stats object with zero-size histogram git-svn-id: http://svn.osgeo.org/postgis/trunk@15739 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/gserialized_estimate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgis/gserialized_estimate.c b/postgis/gserialized_estimate.c index ea343495b..a63bfff67 100644 --- a/postgis/gserialized_estimate.c +++ b/postgis/gserialized_estimate.c @@ -1561,7 +1561,7 @@ compute_gserialized_stats_mode(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfu histo_cells_new = 1; for ( d = 0; d < ndims; d++ ) { - histo_size[d] = (int)pow((double)histo_cells_target, 1/(double)ndims); + histo_size[d] = 1 + (int)pow((double)histo_cells_target, 1/(double)ndims); POSTGIS_DEBUGF(3, " histo_size[d]: %d", histo_size[d]); histo_cells_new *= histo_size[d]; } -- 2.50.1