From: Nicklas Avén Date: Sun, 18 Aug 2013 21:59:02 +0000 (+0000) Subject: Fix wrong size-calculation when mixed types in aggregated twkb X-Git-Tag: 2.2.0rc1~1397 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fa7a08cf99e0e4cc5e87f3946f358db5f95e88e;p=postgis Fix wrong size-calculation when mixed types in aggregated twkb git-svn-id: http://svn.osgeo.org/postgis/trunk@11839 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwout_twkb.c b/liblwgeom/lwout_twkb.c index af8a943fb..16a529ff6 100644 --- a/liblwgeom/lwout_twkb.c +++ b/liblwgeom/lwout_twkb.c @@ -93,7 +93,6 @@ static uint8_t lwgeom_twkb_type(const LWGEOM *geom, uint8_t variant) */ static inline int wkb_swap_bytes(uint8_t variant) { - LWDEBUGF(2, "Entered wkb_swap_bytes",0); /* If requested variant matches machine arch, we don't have to swap! */ if ( ((variant & WKB_NDR) && (getMachineEndian() == NDR)) || ((! (variant & WKB_NDR)) && (getMachineEndian() == XDR)) ) @@ -1272,7 +1271,7 @@ uint8_t* lwgeom_agg_to_twkb(const twkb_geom_arrays *lwgeom_arrays,uint8_t varian if(chk_homogenity==0) return NULL; if(chk_homogenity>1) - buf_size=6; + buf_size = 2+u_getvarint_size((unsigned long) chk_homogenity); else buf_size=1;