[postgis-tickets] r15240 - Do not continue execution of getPoint4d_p on error

Sandro Santilli strk at kbt.io
Mon Nov 21 07:27:06 PST 2016


Author: strk
Date: 2016-11-21 07:27:06 -0800 (Mon, 21 Nov 2016)
New Revision: 15240

Modified:
   trunk/liblwgeom/lwgeom_api.c
Log:
Do not continue execution of getPoint4d_p on error

Modified: trunk/liblwgeom/lwgeom_api.c
===================================================================
--- trunk/liblwgeom/lwgeom_api.c	2016-11-21 15:24:13 UTC (rev 15239)
+++ trunk/liblwgeom/lwgeom_api.c	2016-11-21 15:27:06 UTC (rev 15240)
@@ -239,6 +239,8 @@
  * will set point's m=NO_M_VALUE  if pa is 3d or 2d
  *
  * NOTE: this will modify the point4d pointed to by 'point'.
+ *
+ * @return 0 on error, 1 on success
  */
 int
 getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *op)
@@ -252,6 +254,7 @@
 	if ( (n<0) || (n>=pa->npoints))
 	{
 		lwerror("getPoint4d_p: point offset out of range");
+		return 0;
 	}
 #endif
 
@@ -288,6 +291,7 @@
 
 	default:
 		lwerror("Unknown ZM flag ??");
+		return 0;
 	}
 	return 1;
 



More information about the postgis-tickets mailing list