Ticket #698 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

[MapServer]Raster layer with tileindex is not displayed

Reported by: nsavard@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL Support Version: 4.3
Severity: normal Keywords: VERIFIED
Cc:

Description

Raster layer with associated tileindex is not displayed within a MapServer
template.  A tiff layer is loaded correctly within a similar template.


I'll attach the MapServer template, map file and the query templates
(raster_query2.tgz).  Data used is the one that comes with msautotest tests
suite. This data needs to be copied in "raster_query2/" directory.

Fedora Core 1
Mozilla 1.6
MapServer CVS 20040528

Attachments

raster_query2.tgz Download (2.1 KB) - added by nsavard@… 9 years ago.
MapServer template and map file

Change History

Changed 9 years ago by nsavard@…

MapServer template and map file

Changed 9 years ago by mturk@…

  • summary changed from [MapServer]Raster layer with tileindex is not displayed to [MapServer]Raster layer with tileindex is not displayed
Here is the patch:
The bug is caused by the fact that filename is assigned a value later freed by 
closing shapefile.


Index: mapraster.c
===================================================================
RCS file: /data2/cvsroot/mapserver/mapraster.c,v
retrieving revision 1.116
diff -u -r1.116 mapraster.c
--- mapraster.c	28 May 2004 18:34:34 -0000	1.116
+++ mapraster.c	30 May 2004 11:06:57 -0000
@@ -1325,11 +1325,11 @@
       if(status == MS_DONE) break; // no more tiles/images
        
       if(layer->data == NULL) // assume whole filename is in attribute field
-  	    filename = tshp.values[tileitemindex];
+  	    strcpy(tilename, tshp.values[tileitemindex]);
       else {  
 	    sprintf(tilename, "%s/%s", tshp.values[tileitemindex], layer->data);
-	    filename = tilename;
       }
+      filename = tilename;
       
       msFreeShape(&tshp); // done with the shape
     } else {


Changed 9 years ago by nsavard@…

This patch fixed the problem.  Please set it as fixed and commit to CVS.

Changed 9 years ago by fwarmerdam

  • status changed from new to closed
  • resolution set to fixed
I have reviewed and applied this patch.  Technically the problem is that
the tileindex shape was freed before the filename was used.  This was recently
introduced (by Steve I think) in an effort to fix the leaking of the tileindex
shapes. 

I have verified that this bug did not exist in the 4.2 branch.

Changed 9 years ago by fwarmerdam

Also..

Thanks Mladen!  


Changed 9 years ago by nsavard@…

  • keywords VERIFIED added
Verified on Fedora Core 1.
Note: See TracTickets for help on using tickets.