ASYLUM: sanity check for a possible assertion in Polygon::contains

This commit is contained in:
Alex Bevilacqua 2011-07-19 09:31:59 +08:00 committed by Eugene Sandulenko
parent a663c3da75
commit 2608705d6d
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -33,6 +33,11 @@ bool Polygon::contains(const Common::Point &point) {
bool yflag1;
bool inside_flag = false;
// if no points are defined, an intersect check will fail
// (count - 1 would trigger an assertion in vtx0)
if (points.size() == 0)
return false;
Common::Point *vtx0 = &points[count() - 1];
Common::Point *vtx1 = &points[0];