[SCM] PostGIS branch master updated. 3.5.0-7-gacf75fe47
git at osgeo.org
git at osgeo.org
Sun Sep 29 11:21:37 PDT 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via acf75fe476dd8d37e29530c2bf1958866e394f54 (commit)
from 08846ecfb7fa2203ce6033456623c8394758bf04 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit acf75fe476dd8d37e29530c2bf1958866e394f54
Author: Regina Obe <lr at pcorp.us>
Date: Sun Sep 29 14:18:44 2024 -0400
FIX for segfault in ST_MapAlgebra
References #5785 for PostGIS 3.6.0
Author: Dian M Fay
diff --git a/doc/introduction.xml b/doc/introduction.xml
index caa1b1e76..ab0e295bd 100644
--- a/doc/introduction.xml
+++ b/doc/introduction.xml
@@ -252,6 +252,7 @@
<member>David Garnier</member>
<member>David Skea</member>
<member>David Techer</member>
+ <member>Dian M Fay</member>
<member>Dmitry Vasilyev</member>
<member>Eduin Carrillo</member>
<member>Esteban Zimanyi</member>
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index d821a2fa6..d898c63af 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -1179,6 +1179,11 @@ static int rtpg_nmapalgebraexpr_callback(
if (idx < 1) continue;
idx--; /* 1-based now 0-based */
+ if (arg->rasters == 1 && i > 7) {
+ elog(ERROR, "rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster invocation");
+ return 0;
+ }
+
switch (i) {
/* [rast.x] */
case 0:
diff --git a/raster/test/regress/rt_mapalgebra_expr.sql b/raster/test/regress/rt_mapalgebra_expr.sql
index 240deb85c..78f90bb21 100644
--- a/raster/test/regress/rt_mapalgebra_expr.sql
+++ b/raster/test/regress/rt_mapalgebra_expr.sql
@@ -128,6 +128,11 @@ SELECT ST_Value(rast, 1, 1),
ST_Value(ST_MapAlgebra(rast, 1, NULL, '[rast]/0'), 1, 1)
FROM ST_TestRaster(0, 0, 10) rast;
+-- Test being cheeky with rast2 in a single-rast invocation
+SELECT ST_Value(rast, 1, 1),
+ ST_Value(ST_MapAlgebra(rast, 1, NULL, '[rast2.val]+1'), 1, 1)
+FROM ST_TestRaster(0, 0, 10) rast;
+
-- Test evaluations to null (see #1523)
WITH op AS ( select rast AS rin,
ST_MapAlgebra(rast, 1, NULL, 'SELECT g from (SELECT NULL::double precision as g) as foo', 2)
diff --git a/raster/test/regress/rt_mapalgebra_expr_expected b/raster/test/regress/rt_mapalgebra_expr_expected
index ac33621e0..dccd7fc46 100644
--- a/raster/test/regress/rt_mapalgebra_expr_expected
+++ b/raster/test/regress/rt_mapalgebra_expr_expected
@@ -18,6 +18,7 @@ T10.8.2|10|50
T10.8.3|10|37
T10.8.4|10|30
ERROR: division by zero
+ERROR: rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster invocation
T11.1|10|2
T11.2|10|2
T12|t|t|t|t
-----------------------------------------------------------------------
Summary of changes:
doc/introduction.xml | 1 +
raster/rt_pg/rtpg_mapalgebra.c | 5 +++++
raster/test/regress/rt_mapalgebra_expr.sql | 5 +++++
raster/test/regress/rt_mapalgebra_expr_expected | 1 +
4 files changed, 12 insertions(+)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list