postgis.git / summary / log / commit / refs

commit    2851cd1908dc138d6a6ec389fdbedc8fc93f5e73
Author:   Paul Ramsey <pramsey@cleverelephant.ca>
Date:     Tue Apr 27 18:02:15 2021 +0000

    Avoid doom loop when sampling a vertex outside the range of a geometry in ST_SetZ(). Closes #4898


raster/rt_core/rt_raster.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/raster/rt_core/rt_raster.c b/raster/rt_core/rt_raster.c index 7ceecbafc..5e0908381 100644 --- a/raster/rt_core/rt_raster.c +++ b/raster/rt_core/rt_raster.c @@ -33,6 +33,10 @@ #include <math.h> +#ifndef NAN +# define NAN 0.0/0.0 +#endif + /** * Construct a raster with given dimensions. * @@ -1675,7 +1679,10 @@ rt_raster_copy_to_geometry( resample, &value, &nodata ); - if (err != ES_NONE) continue; + + if (err != ES_NONE) { + value = NAN; + } /* Copy in the raster value */ if (dim == 'z') [parent: d07fec913e5a]