Opened 16 years ago

Closed 16 years ago

#2726 closed defect (fixed)

Hang while drawing label cache with angle=follow

Reported by: jimk Owned by: tbonfort
Priority: normal Milestone:
Component: MapServer C Library Version: 5.2
Severity: normal Keywords:
Cc:

Description

I am seeing strange behavior with one of my mapfiles in Mapserver 5.2.0 that isn't in 5.0.2.

What appears to be happening is while drawing the label cache, msDrawShadeSymbol is being called with a "billboard" argument that is not fully initialized. In particular the billboard.points array appears uninitialized which is causing a range of ymin to ymax in msDrawShadeSymbol to be in my case -232 to 161306 instead of the normal values which appear to be somewhere within the image size requested. If you break out of msDrawShadeSymbol and return to msDrawLabelCache, future iterations of the loop appear to work ok.

In msDrawLableCache, it appears that the lines that update the points in billboard (via billboard.line), which are calls to get_metrics_line(), are protected by "if(MS_VALID_COLOR(labelPtr->backgroundcolor))". The call to msDrawLabelCache is similarly protected.

The strange part is if labelPtr->labelpath is true (a path following label) the part of the code setting the background is skipped thus billboard.points never gets set. If MS_VALID_COLOR(labelPtr->backgroundcolor) is also true msDrawShadeSymbol is called with billboard uninitialized.

The attached patch allows Mapserver to complete the request by not drawing the background if the the label follows the line, but it is sub-optimal because the labels set to follow lines no longer have a background.

Attachments (1)

mapdraw-angle-follow.patch (1.6 KB ) - added by jimk 16 years ago.

Download all attachments as: .zip

Change History (3)

by jimk, 16 years ago

Attachment: mapdraw-angle-follow.patch added

comment:1 by tbonfort, 16 years ago

Owner: changed from sdlime to tbonfort
Status: newassigned

comment:2 by tbonfort, 16 years ago

Resolution: fixed
Status: assignedclosed

fixed in r7946

drawing a background an follow label makes no sense anyways

Note: See TracTickets for help on using tickets.