]> granicus.if.org Git - postgis/commitdiff
Do not continue execution of getPoint4d_p on error
authorSandro Santilli <strk@kbt.io>
Mon, 21 Nov 2016 15:27:06 +0000 (15:27 +0000)
committerSandro Santilli <strk@kbt.io>
Mon, 21 Nov 2016 15:27:06 +0000 (15:27 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@15240 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom_api.c

index ed1538ab360a6f472b2125503410434208b1b162..deb1071e3116398a7e82a08b9992231e8a55c71b 100644 (file)
@@ -239,6 +239,8 @@ getPoint4d(const POINTARRAY *pa, int n)
  * 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 @@ getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *op)
        if ( (n<0) || (n>=pa->npoints))
        {
                lwerror("getPoint4d_p: point offset out of range");
+               return 0;
        }
 #endif
 
@@ -288,6 +291,7 @@ getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *op)
 
        default:
                lwerror("Unknown ZM flag ??");
+               return 0;
        }
        return 1;