avoid inf loop on empty point3d shapefile
This commit is contained in:
parent
884de5a044
commit
5424c350cd
1 changed files with 11 additions and 7 deletions
|
@ -165,17 +165,23 @@ int main (int argc,char** argv)
|
|||
box2d<double> item_ext;
|
||||
if (shape_type==shape_io::shape_null)
|
||||
{
|
||||
// still need to increment pos, or the pos counter
|
||||
// won't indicate EOF until too late.
|
||||
pos+=4+content_length;
|
||||
continue;
|
||||
if (pos >= file_length)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
// still need to increment pos, or the pos counter
|
||||
// won't indicate EOF until too late.
|
||||
pos+=4+content_length;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (shape_type==shape_io::shape_point)
|
||||
{
|
||||
double x=shp.read_double();
|
||||
double y=shp.read_double();
|
||||
item_ext=box2d<double>(x,y,x,y);
|
||||
|
||||
}
|
||||
else if (shape_type==shape_io::shape_pointm)
|
||||
{
|
||||
|
@ -184,7 +190,6 @@ int main (int argc,char** argv)
|
|||
// skip m
|
||||
shp.read_double();
|
||||
item_ext=box2d<double>(x,y,x,y);
|
||||
|
||||
}
|
||||
else if (shape_type==shape_io::shape_pointz)
|
||||
{
|
||||
|
@ -209,7 +214,6 @@ int main (int argc,char** argv)
|
|||
shp.read_double();
|
||||
}
|
||||
item_ext=box2d<double>(x,y,x,y);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue