From 697466ebbb94540facce5c6b922d6517a59f3c28 Mon Sep 17 00:00:00 2001 From: Olivier Courtin Date: Wed, 8 Feb 2012 15:17:32 +0000 Subject: [PATCH] Bugfixes related to #1552, and somehow to #665. Thanks to Sandro for report and valgrind stuff ! git-svn-id: http://svn.osgeo.org/postgis/trunk@9097 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/libtgeom.c | 4 ++-- liblwgeom/libtgeom.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/liblwgeom/libtgeom.c b/liblwgeom/libtgeom.c index 8a5432720..e575919ba 100644 --- a/liblwgeom/libtgeom.c +++ b/liblwgeom/libtgeom.c @@ -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; diff --git a/liblwgeom/libtgeom.h b/liblwgeom/libtgeom.h index 0a3f77ccd..48dd9ed22 100644 --- a/liblwgeom/libtgeom.h +++ b/liblwgeom/libtgeom.h @@ -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; -- 2.40.0