Ticket #2726 (closed defect: fixed)
Hang while drawing label cache with angle=follow
|Reported by:||jimk||Owned by:||tbonfort|
|Component:||MapServer C Library||Version:||5.2|
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.