[mapserver-commits] r9502 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Thu Oct 22 16:37:45 EDT 2009


Author: warmerdam
Date: 2009-10-22 16:37:44 -0400 (Thu, 22 Oct 2009)
New Revision: 9502

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/maprasterquery.c
Log:
only apply maxresults if non-zero, check rlinfo before using (#3181, #3168)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-10-22 20:16:23 UTC (rev 9501)
+++ trunk/mapserver/HISTORY.TXT	2009-10-22 20:37:44 UTC (rev 9502)
@@ -24,6 +24,9 @@
 
 - Python/MapScript: improve compatability for different swig versions (#3180)
 
+- maprasterquery.c: a few fixes since beta4 (#3181, #3168).
+
+
 Version 5.6.0-beta4 (2009-10-18):
 ---------------------------------
 

Modified: trunk/mapserver/maprasterquery.c
===================================================================
--- trunk/mapserver/maprasterquery.c	2009-10-22 20:16:23 UTC (rev 9501)
+++ trunk/mapserver/maprasterquery.c	2009-10-22 20:37:44 UTC (rev 9502)
@@ -866,7 +866,8 @@
         msRasterLayerInfoFree( layer );
 
     /* populate the items/numitems layer-level values */
-    msRASTERLayerGetItems(layer);
+    if( layer->layerinfo != NULL )
+        msRASTERLayerGetItems(layer);
 
     return status;
 #endif /* def USE_GDAL */
@@ -996,11 +997,18 @@
     bufferRect.maxy = p.y + buffer;
 
     rlinfo->range_mode = mode;
-    previous_maxresults = rlinfo->query_result_hard_max;
-    rlinfo->query_result_hard_max = maxresults;
+
+    if( maxresults != 0 )
+    {
+        previous_maxresults = rlinfo->query_result_hard_max;
+        rlinfo->query_result_hard_max = maxresults;
+    }
+
     result = msRasterQueryByRect( map, layer, bufferRect );
-    rlinfo->query_result_hard_max = previous_maxresults;
 
+    if( rlinfo != NULL && maxresults != 0 )
+        rlinfo->query_result_hard_max = previous_maxresults;
+
     return result;
 #endif /* USE_GDAL  */
 }
@@ -1269,6 +1277,9 @@
 #else
     rasterLayerInfo *rlinfo = (rasterLayerInfo *) layer->layerinfo;
 
+    if( rlinfo == NULL )
+        return MS_FAILURE;
+
     layer->items = (char **) calloc(sizeof(char *),10);
 
     layer->numitems = 0;



More information about the mapserver-commits mailing list