Break potential infinite loop in msProjectSegment (#4961)
Merge pull request #4963 from szekerest/issue4961

Break potential infinite loop in msProjectSegment (#4961)