Mapster32: fix possible integer overflow in loopinside().

This could happen when building outside the "classic" grid limits and would
then lead to e.g. incorrect loop assignment on sector splitting. Bug reported
by MetHy.

git-svn-id: https://svn.eduke32.com/eduke32@4572 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-08-16 18:32:47 +00:00
parent 3aaf167d6b
commit 63916ee8d1

View file

@ -8854,7 +8854,7 @@ int32_t loopinside(int32_t x, int32_t y, int16_t startwall)
}
if (y1 <= y && y < y2)
if (x1*(y-y2)+x2*(y1-y) <= x*(y1-y2))
if ((uint64_t)x1*(y-y2) + (uint64_t)x2*(y1-y) <= (uint64_t)x*(y1-y2))
cnt ^= 1;
}