2002 {
2003
2004 int nSHPContentLength;
2005 memcpy( &nSHPContentLength, psSHP->pabyRec + 4, 4 );
2007 if( nSHPContentLength < 0 ||
2008 nSHPContentLength > INT_MAX / 2 - 4 ||
2010 {
2012 snprintf(
str,
sizeof(
str),
2013 "Sanity check failed when trying to recover from inconsistent .shx/.shp with shape %d",
2014 hEntity );
2015 str[
sizeof(
str)-1] =
'\0';
2016
2017 psSHP->sHooks.Error(
str );
2019 }
2020 }
static void SwapWord(int length, void *wordP)