Commit ae28b2dc authored by Raúl Marín's avatar Raúl Marín

Fix undefined behaviour in raster intersection

Closes #4249
Closes https://github.com/postgis/postgis/pull/340




git-svn-id: http://svn.osgeo.org/postgis/trunk@17043 b70326c6-7e19-0410-871a-916f4a2858ee
parent a8cbd5f1
Pipeline #37408101 passed with stage
in 30 minutes and 58 seconds
...@@ -40,6 +40,7 @@ PostGIS 3.0.0 ...@@ -40,6 +40,7 @@ PostGIS 3.0.0
- #4190, Avoid undefined behaviour in gserialized_estimate (Raúl Marín) - #4190, Avoid undefined behaviour in gserialized_estimate (Raúl Marín)
- #4233, Fix undefined behaviour in gserialized_spgist_picksplit_nd (Raúl Marín) - #4233, Fix undefined behaviour in gserialized_spgist_picksplit_nd (Raúl Marín)
- #4247, Avoid undefined behaviour in next_float functions (Raúl Marín) - #4247, Avoid undefined behaviour in next_float functions (Raúl Marín)
- #4249, Fix undefined behaviour in raster intersection (Raúl Marín)
PostGIS 2.5.0 PostGIS 2.5.0
2018/09/23 2018/09/23
......
...@@ -715,11 +715,9 @@ int rt_raster_intersects_algorithm( ...@@ -715,11 +715,9 @@ int rt_raster_intersects_algorithm(
gt2 gt2
); );
/* parallel vertically */ /* Parallel lines */
if (FLT_EQ(line1[X2] - line1[X1], 0.) && FLT_EQ(line2[X2] - line2[X1], 0.)) if (FLT_EQ(((line1[X2] - line1[X1]) * (line2[Y2] - line2[Y1])),
byHeight = 0; ((line2[X2] - line2[X1]) * (line1[Y2] - line1[Y1]))))
/* parallel */
else if (FLT_EQ(((line1[Y2] - line1[Y1]) / (line1[X2] - line1[X1])), ((line2[Y2] - line2[Y1]) / (line2[X2] - line2[X1]))))
byHeight = 0; byHeight = 0;
if (byHeight) if (byHeight)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment