]> granicus.if.org Git - postgis/commitdiff
bugfix to fix for #4461
authorNicklas Avén <nicklas.aven@jordogskog.no>
Thu, 1 Aug 2019 13:28:52 +0000 (13:28 +0000)
committerNicklas Avén <nicklas.aven@jordogskog.no>
Thu, 1 Aug 2019 13:28:52 +0000 (13:28 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@17655 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwout_twkb.c

index 381dca78d3a4d7b9f9feab7e7ef3f87a41d70675..0286ab55e1b807b993689af723a766c3a42531d1 100644 (file)
@@ -174,7 +174,7 @@ static int ptarray_to_twkb_buf(const POINTARRAY *pa, TWKB_GLOBALS *globals, TWKB
                /* Skipping the first point is not allowed */
                /* If the sum(abs()) of all the deltas was zero, */
                /* then this was a duplicate point, so we can ignore it */
-               if ( diff == 0 &&  max_points_left > minpoints )
+               if ( i > 0 && diff == 0 &&  max_points_left > minpoints )
                {
                        max_points_left--;
                        continue;