ST_LocateBetweenElevations: fix segfault on interrupt

main
kalenik 2021-09-22 12:30:41 +03:00
parent cb726d5cd6
commit 33b01e0177
1 changed files with 6 additions and 0 deletions

View File

@ -736,6 +736,9 @@ lwpoly_clip_to_ordinate_range(const LWPOLY *poly, char ordinate, double from, do
/* Ret number of points */
POINTARRAY *pa = ptarray_clamp_to_ordinate_range(poly->rings[i], ordinate, from, to, LW_TRUE);
if (!pa)
return NULL;
if (pa->npoints >= 4)
lwpoly_add_ring(poly_res, pa);
else
@ -764,6 +767,9 @@ lwtriangle_clip_to_ordinate_range(const LWTRIANGLE *tri, char ordinate, double f
LWCOLLECTION *lwgeom_out = lwcollection_construct_empty(TINTYPE, tri->srid, hasz, hasm);
POINTARRAY *pa = ptarray_clamp_to_ordinate_range(tri->points, ordinate, from, to, LW_TRUE);
if (!pa)
return NULL;
if (pa->npoints >= 4)
{
POINT4D first = getPoint4d(pa, 0);