24-bit image processing crash
Frank,
I've got a build of Mapserver on Win2k (nightly snapshot from 2003/01/14,
GD-2.0.10,with GDAL-1.1.8). It crashes when I have a CLASS defined for a raster
layer of a 24-bit tif:
LAYER
NAME 'TopoMaps'
GROUP "Raster Backdrops"
TYPE raster
STATUS on
PROJECTION
"proj=utm"
"ellps=WGS84"
"zone=12"
"north"
END
DATA 'C:\Inetpub\wwwroot\modis\site\basemap\072l12nc_83_24.tif'
# DATA 'C:\Inetpub\wwwroot\modis\site\basemap\072l12nc_83.tif'
CLASS
NAME "1:50k Topomaps"
END
END # LAYER
But doesn't crash when the tif is 8-bit /paletted (then it renders all the
pixels as blue, but that's a different problem).
In the debugger it shows it's caused by msDrawRasterLayerGDAL (mapdrawgdal.c
around line 414) :
======================================================================
/*
* Setup the mapping between source eightbit pixel values, and the
* output images color table. There are two general cases, where the
* class colors are provided by the MAP file, or where we use the native
* color table.
*/
if(layer->numclasses > 0 && gdImg ) {
int c;
cmap_set = TRUE;
for(i=0; i<GDALGetColorEntryCount(hColorMap); i++) {
GDALColorEntry sEntry;
colorObj pixel;
GDALGetColorEntryAsRGB( hColorMap, i, &sEntry );
=======================================================================
It appears to crash since hColorMap is NULL and the called function attempts to
access it's data members.
I'm not clear why msDrawRasterLayerGDAL is trying to do ColorMap processing on a
24-bit image.
Any thoughts?
Brent Fraser
GeoAnalytic Inc.
Tel:(403) 213-2700
bfraser@geoanalytic.com
www.geoanalytic.com
Change History
(7)
Owner: |
changed from fwarmerdam to sdlime
|
Severity: |
normal → enhancement
|
Resolution: |
→ fixed
|
Status: |
new → closed
|