#include "liblwgeom_internal.h" /* NOTE: includes lwgeom_log.h */
#include "lwgeom_log.h"
#include <math.h>
+#include <limits.h>
/**
* Used for passing the parse state between the parsing functions.
size_t pa_size;
uint32_t ndims = 2;
uint32_t npoints = 0;
- static uint32_t maxpoints = 4294967295 / WKB_DOUBLE_SIZE / 4;
+ static uint32_t maxpoints = UINT_MAX / WKB_DOUBLE_SIZE / 4;
/* Calculate the size of this point array. */
npoints = integer_from_wkb_state(s);
if (npoints > maxpoints)
{
lwerror("Pointarray length (%d) is too large");
- return;
+ return NULL;
}
LWDEBUGF(4,"Pointarray has %d points", npoints);