[mapserver-dev] msProjectRect may enter to infinite loop

Daniel Morissette dmorissette at mapgears.com
Wed Jul 23 05:30:26 PDT 2014


Seems fine to me at first sight.

Daniel


On 14-07-23 5:57 AM, Tamas Szekeres wrote:
> 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
> <mailto: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
>
>
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>


-- 
Daniel Morissette
T: +1 418-696-5056 #201
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000


More information about the mapserver-dev mailing list