[mapserver-commits] r10378 - branches/branch-5-4/mapserver
svn at osgeo.org
svn at osgeo.org
Thu Jul 22 04:16:24 EDT 2010
Author: tbonfort
Date: 2010-07-22 08:16:24 +0000 (Thu, 22 Jul 2010)
New Revision: 10378
Modified:
branches/branch-5-4/mapserver/HISTORY.TXT
branches/branch-5-4/mapserver/mapprimitive.c
Log:
Fix computation of shape bounds when the first line contains no points (#3119)(fixes #3383)
Modified: branches/branch-5-4/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-4/mapserver/HISTORY.TXT 2010-07-21 12:50:02 UTC (rev 10377)
+++ branches/branch-5-4/mapserver/HISTORY.TXT 2010-07-22 08:16:24 UTC (rev 10378)
@@ -13,6 +13,8 @@
Current Version:
----------------
+- Fix computation of shape bounds when the first line contains no points
+ (#3119)(fixes #3383)
- Disabled some insecure (and potentially exploitable) mapserv command-line
debug arguments (#3485). The --enable-cgi-cl-debug-args configure switch
Modified: branches/branch-5-4/mapserver/mapprimitive.c
===================================================================
--- branches/branch-5-4/mapserver/mapprimitive.c 2010-07-21 12:50:02 UTC (rev 10377)
+++ branches/branch-5-4/mapserver/mapprimitive.c 2010-07-22 08:16:24 UTC (rev 10378)
@@ -186,12 +186,16 @@
void msComputeBounds(shapeObj *shape)
{
int i, j;
-
if(shape->numlines <= 0) return;
- if(shape->line[0].numpoints <= 0) return;
-
- shape->bounds.minx = shape->bounds.maxx = shape->line[0].point[0].x;
- shape->bounds.miny = shape->bounds.maxy = shape->line[0].point[0].y;
+ for(i=0;i<shape->numlines;i++) {
+ if(shape->line[i].numpoints > 0) {
+ shape->bounds.minx = shape->bounds.maxx = shape->line[i].point[0].x;
+ shape->bounds.miny = shape->bounds.maxy = shape->line[i].point[0].y;
+ break;
+ }
+ }
+ if(i == shape->numlines)
+ return; //no lines inside the shape contain any points
for( i=0; i<shape->numlines; i++ ) {
for( j=0; j<shape->line[i].numpoints; j++ ) {
More information about the mapserver-commits
mailing list