Apparently there's a problem with overflow in REGION_CreateEdgeTable. The function itself checks for overflow and returns 0 in this case, but the call site doesn't (that's why checking for it works).
I've submitted a new version along with a test that demonstrates this. Without the check, the test hangs.