]> granicus.if.org Git - postgis/commitdiff
Bugfixes related to #1552, and somehow to #665. Thanks to Sandro for report and valgr...
authorOlivier Courtin <olivier.courtin@camptocamp.com>
Wed, 8 Feb 2012 15:17:32 +0000 (15:17 +0000)
committerOlivier Courtin <olivier.courtin@camptocamp.com>
Wed, 8 Feb 2012 15:17:32 +0000 (15:17 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9097 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/libtgeom.c
liblwgeom/libtgeom.h

index 8a54327207a8164d15c1320edab77a76072d9623..e575919ba5f9284b82bf38ff9f662876bb880c28 100644 (file)
@@ -854,8 +854,8 @@ tgeom_deserialize(TSERIALIZED *serialized_form)
        /* srid */
        result->srid = lw_get_int32_t(loc);
        loc += 4;
-       /* bbox */
 
+       /* bbox */
        if (FLAGS_GET_BBOX(flags))
        {
                result->bbox = lwalloc(sizeof(BOX3D));
@@ -932,7 +932,7 @@ tgeom_deserialize(TSERIALIZED *serialized_form)
                /* edges array */
                result->faces[i]->edges = lwalloc(sizeof(TEDGE*)
                                                  * result->faces[i]->nedges);
-               memcpy(result->faces[i]->edges, loc, sizeof(TEDGE*)
+               memcpy(result->faces[i]->edges, loc, sizeof(int32_t)
                       * result->faces[i]->nedges);
                loc  += 4 * result->faces[i]->nedges;
 
index 0a3f77ccd746f82a620b424346044ad8e5fd0ec7..48dd9ed22dc95a21e7458d12271f88d5adfd7f0d 100644 (file)
@@ -38,11 +38,11 @@ typedef struct
 
 typedef struct
 {
-       int nedges;
-       int maxedges;
-       int *edges;             /* Array of edge index, a negative value
+       uint32_t nedges;
+       uint32_t maxedges;
+       int32_t *edges;         /* Array of edge index, a negative value
                                   means that the edge is reversed */
-       int nrings;
+       int32_t nrings;
        POINTARRAY **rings;     /* Internal rings array */
 } TFACE;
 
@@ -52,11 +52,11 @@ typedef struct
        uint8_t flags;          
        uint32_t srid;          /* 0 == unknown */
        BOX3D *bbox;            /* NULL == unneeded */
-       int nedges;
-       int maxedges;
+       uint32_t nedges;
+       uint32_t maxedges;
        TEDGE **edges;
-       int nfaces;
-       int maxfaces;
+       uint32_t nfaces;
+       uint32_t maxfaces;
        TFACE **faces;
 } TGEOM;