[mapserver-commits] r11734 - branches/branch-6-0/mapserver

svn at osgeo.org svn at osgeo.org
Fri May 20 16:19:04 EDT 2011


Author: warmerdam
Date: 2011-05-20 13:19:04 -0700 (Fri, 20 May 2011)
New Revision: 11734

Modified:
   branches/branch-6-0/mapserver/mapresample.c
Log:
avoid xmin/ymin/xmax/ymax going off raster for average resampling (#3886)

Modified: branches/branch-6-0/mapserver/mapresample.c
===================================================================
--- branches/branch-6-0/mapserver/mapresample.c	2011-05-20 20:12:13 UTC (rev 11733)
+++ branches/branch-6-0/mapserver/mapresample.c	2011-05-20 20:19:04 UTC (rev 11734)
@@ -661,10 +661,10 @@
             dfYMax = MAX(MAX(y1[nDstX],y1[nDstX+1]),
                          MAX(y2[nDstX],y2[nDstX+1]));
 
-            dfXMin = MAX(dfXMin,0);
-            dfYMin = MAX(dfYMin,0);
-            dfXMax = MIN(dfXMax,psSrcImage->width);
-            dfYMax = MIN(dfYMax,psSrcImage->height);
+            dfXMin = MIN(MAX(dfXMin,0),psSrcImage->width+1);
+            dfYMin = MIN(MAX(dfYMin,0),psSrcImage->height+1);
+            dfXMax = MIN(MAX(-1,dfXMax),psSrcImage->width);
+            dfYMax = MIN(MAX(-1,dfYMax),psSrcImage->height);
                 
             memset( padfPixelSum, 0, sizeof(double)*bandCount );
     



More information about the mapserver-commits mailing list