]> granicus.if.org Git - postgis/commitdiff
Fix wrong size-calculation when mixed types in aggregated twkb
authorNicklas Avén <nicklas.aven@jordogskog.no>
Sun, 18 Aug 2013 21:59:02 +0000 (21:59 +0000)
committerNicklas Avén <nicklas.aven@jordogskog.no>
Sun, 18 Aug 2013 21:59:02 +0000 (21:59 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11839 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwout_twkb.c

index af8a943fb4e8eb290fee2a51fe84f1a38bb42170..16a529ff6883013089455703137424377f57e1e1 100644 (file)
@@ -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;