[mapserver-commits] r11732 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri May 20 16:11:01 EDT 2011


Author: warmerdam
Date: 2011-05-20 13:11:01 -0700 (Fri, 20 May 2011)
New Revision: 11732

Modified:
   trunk/mapserver/mapresample.c
Log:
avoid xmin/ymin/xmax/ymax going off raster for average resampling (#3886)

Modified: trunk/mapserver/mapresample.c
===================================================================
--- trunk/mapserver/mapresample.c	2011-05-20 15:45:14 UTC (rev 11731)
+++ trunk/mapserver/mapresample.c	2011-05-20 20:11:01 UTC (rev 11732)
@@ -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 );
     
@@ -1512,6 +1512,8 @@
     sDummyMap.outputformat = msCloneOutputFormat( image->format );
     sDummyMap.width = nLoadImgXSize;
     sDummyMap.height = nLoadImgYSize;
+    sDummyMap.mappath = map->mappath;
+    sDummyMap.shapepath = map->shapepath;
     
 /* -------------------------------------------------------------------- */
 /*      If we are working in 256 color GD mode, allocate 0 as the       */



More information about the mapserver-commits mailing list