BUG: off-by-one error in PPoly shape checks

(cherry picked from commit 90a979f30acadad373ee59d3453cfe6e0962bf78)