
These were reported by Coverity Scan. They're extremely unlikely but still possible - if all edges of a poly are FLT_MAX or further away from the input point, a negative index may be used to access the verts array of a poly. The fix is to arbitrarily pick the first edge as the closest in case all are tied as being very far away.