Skip to content

Commit

Permalink
Update shapelib_backports.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Apr 5, 2014
1 parent 70fd35b commit f0a1a20
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions shapelib_backports.patch
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ index fbe7b06..69d8098 100644
sprintf( pszFullname, "%s.cpg", pszBasename );
if( pszCodePage != NULL )
diff --git a/shptree.c b/shptree.c
index 409134e..00673aa 100644
index 409134e..4fccfab 100644
--- a/shptree.c
+++ b/shptree.c
@@ -844,22 +844,23 @@ void SHPCloseDiskTree( SHPTreeDiskHandle hDiskTree )
@@ -93,6 +93,7 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>

#ifdef USE_CPL
#include "cpl_error.h"
@@ -844,22 +845,23 @@ void SHPCloseDiskTree( SHPTreeDiskHandle hDiskTree )
static int
SHPSearchDiskTreeNode( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, double *padfBoundsMax,
int **ppanResultBuffer, int *pnBufferMax,
Expand Down Expand Up @@ -61,7 +69,7 @@ index 409134e..00673aa 100644
if ( bNeedSwap )
{
SwapWord( 8, adfNodeBoundsMin + 0 );
@@ -868,9 +869,30 @@ SHPSearchDiskTreeNode( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, doubl
@@ -868,9 +870,30 @@ SHPSearchDiskTreeNode( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, doubl
SwapWord( 8, adfNodeBoundsMax + 1 );
}

Expand Down Expand Up @@ -93,7 +101,7 @@ index 409134e..00673aa 100644
/* -------------------------------------------------------------------- */
/* If we don't overlap this node at all, we can just fseek() */
/* pass this node info and all subnodes. */
@@ -890,13 +912,31 @@ SHPSearchDiskTreeNode( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, doubl
@@ -890,13 +913,31 @@ SHPSearchDiskTreeNode( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, doubl
{
if( *pnResultCount + numshapes > *pnBufferMax )
{
Expand Down Expand Up @@ -129,7 +137,7 @@ index 409134e..00673aa 100644

if (bNeedSwap )
{
@@ -910,14 +950,23 @@ SHPSearchDiskTreeNode( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, doubl
@@ -910,14 +951,23 @@ SHPSearchDiskTreeNode( SHPTreeDiskHandle hDiskTree, double *padfBoundsMin, doubl
/* -------------------------------------------------------------------- */
/* Process the subnodes. */
/* -------------------------------------------------------------------- */
Expand All @@ -155,7 +163,7 @@ index 409134e..00673aa 100644
return FALSE;
}

@@ -1014,7 +1063,7 @@ int* SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree,
@@ -1014,7 +1064,7 @@ int* SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree,
/* -------------------------------------------------------------------- */
if( !SHPSearchDiskTreeNode( hDiskTree, padfBoundsMin, padfBoundsMax,
&panResultBuffer, &nBufferMax,
Expand All @@ -164,7 +172,7 @@ index 409134e..00673aa 100644
{
if( panResultBuffer != NULL )
free( panResultBuffer );
@@ -1025,6 +1074,10 @@ int* SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree,
@@ -1025,6 +1075,10 @@ int* SHPSearchDiskTreeEx( SHPTreeDiskHandle hDiskTree,
/* Sort the id array */
/* -------------------------------------------------------------------- */
qsort(panResultBuffer, *pnShapeCount, sizeof(int), compare_ints);
Expand Down

0 comments on commit f0a1a20

Please sign in to comment.