[GRASS5] [bug #3057] (grass) ps.map segfaults with CELL rasters withouth cat file

this bug's URL: http://intevation.de/rt/webrt?serial_num=3057
-------------------------------------------------------------------------

Subject: ps.map segfaults with CELL rasters withouth cat file

Platform: GNU/Linux/i386
grass obtained from: Mirror of Trento site
grass binary for platform: Compiled from Sources
GRASS Version: grass-6.0.cvs_src_snapshot_2005_02_12

When the raster has an empty catfile like:

---
# 255 categories

0.00 0.00 0.00 0.00
---

and in section "colortable" the "nodata n" is specified, ps.map segfaults as following:

GRASS 6.0.cvs:~ > ps.map input=ps2.txt output=map1.ps
PS-PAINT: scale set to 1 : 347440.
PS-PAINT: reading raster file <gminy in robot> ...
PS-PAINT: outlining areas in raster file <gminy in robot> ...
PS-PAINT: creating color table for <gminy in robot> ...Segmentation fault

It doesn't segfault when the "no data n" is not specified.

I think that in both cases an info should be printed like "WARNING: Your catfile is invalid. A catfile with categories and labels is required for colortable in case of CELL rasters. No colortable will be assigned to this output postscript file."

Maciek

-------------------------------------------- Managed by Request Tracker

this bug's URL: http://intevation.de/rt/webrt?serial_num=3057
---------------------------------------------------------------------

Subject: ps.map segfaults with CELL rasters withouth cat file

..

GRASS Version: grass-6.0.cvs_src_snapshot_2005_02_12

When the raster has an empty catfile like:

---
# 255 categories

0.00 0.00 0.00 0.00
---

and in section "colortable" the "nodata n" is specified, ps.map
segfaults as following:

GRASS 6.0.cvs:~ > ps.map input=ps2.txt output=map1.ps
PS-PAINT: scale set to 1 : 347440.
PS-PAINT: reading raster file <gminy in robot> ...
PS-PAINT: outlining areas in raster file <gminy in robot> ...
PS-PAINT: creating color table for <gminy in robot> ...Segmentation
fault

It doesn't segfault when the "no data n" is not specified.

I think that in both cases an info should be printed like "WARNING:
Your catfile is invalid. A catfile with categories and labels is
required for colortable in case of CELL rasters. No colortable will be
assigned to this output postscript file."

fixed in CVS, warning added.

Hamish