[mapserver-dev] msProjectRect may enter to infinite loop

Tamas Szekeres szekerest at gmail.com
Mon Jul 21 07:00:17 PDT 2014


Hi Devs,

Reprojecting a "very big" rectangle (for example zooming out too far) may
lead to infinite loop in msProjectSegment.

In my case the while loop in mapproject.c line 248-261 causes the issue,
where

midPoint.y = (subStart.y + subEnd.y) * 0.5;

yields the same result as the initial subEnd.y and since the projection is
failing, the loop condition will never change.

What would be the reasonable solution for this issue?
May I think that returning immediately with an error if the loop condition
is not changing would be ok?

I would also think that bringing back the
former msProjectRectTraditionalEdge instead of msProjectRectAsPolygon (in
msProjectRect) would also be reasonable in some conditions.
msProjectRectAsPolygon may be very inefficient regarding to the performance.


Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20140721/e562c8d3/attachment.html>


More information about the mapserver-dev mailing list