[mapserver-dev] msProjectRect may enter to infinite loop

Tamas Szekeres szekerest at gmail.com
Wed Jul 23 02:57:02 PDT 2014


Got no answer, however I've prepared a fix.

https://github.com/szekerest/mapserver/commit/54dda8c1adbc4a423d0f10706e6ee0502b1c04f4

I'd prefer to fix this problem in the stable branch too.

Let me know if anyone has objection to it.

Tamas




2014-07-21 16:00 GMT+02:00 Tamas Szekeres <szekerest at gmail.com>:

> 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/20140723/3d816229/attachment.html>


More information about the mapserver-dev mailing list