Opened 19 years ago

Closed 15 years ago

#1314 closed defect (fixed)

SLD XML colormap entries parse quantity attr as int.

Reported by: kruland@… Owned by: sdlime
Priority: high Milestone: 5.4 release
Component: MapServer C Library Version: 4.4
Severity: normal Keywords:
Cc: assefa, tomkralidis

Description (last modified by sdlime)

Pixel values can be real values.  In order to specify a ColorMap in SLD xml the
quantity attribute needs to support floating point numbers.  In mapogcsld.c at
line 2381 they are parsed as integers.  Also, a potential memory corruption
problem can occurr by using sprintf instead of snprintf.

Change History (4)

comment:1 by tomkralidis, 16 years ago

Cc: assefa tomkralidis added

True. From http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd

 <xsd:element name="ColorMapEntry">
  <xsd:complexType>
   <xsd:attribute name="color" type="xsd:string" use="required"/>
   <xsd:attribute name="opacity" type="xsd:double"/>
   <xsd:attribute name="quantity" type="xsd:double"/>
   <xsd:attribute name="label" type="xsd:string"/>
  </xsd:complexType>
 </xsd:element>

Assefa: looking at mapogcsld.c, it looks like @quantity is already tested for a float or int?

comment:2 by tomkralidis, 16 years ago

Milestone: 5.4 release

Assefa: can you confirm that we are indeed supporting floats in mapogcsld.c? Around line 2364 it appears to support both. We can close if this is the case.

comment:3 by sdlime, 15 years ago

Description: modified (diff)

Any more on this? I'm trying to clean house...

Steve

comment:4 by assefa, 15 years ago

Resolution: fixed
Status: newclosed

support was added some time ago to read float or integer values.

Note: See TracTickets for help on using tickets.