BKE_deform: assert on invalid arguments to BKE_defvert_remove_group

This commit is contained in:
Campbell Barton
2023-09-08 14:56:07 +10:00
parent 3bc9971f26
commit ec89e966d0

View File

@@ -838,6 +838,8 @@ void BKE_defvert_remove_group(MDeformVert *dvert, MDeformWeight *dw)
}
/* Ensure `dw` is part of `dvert` (security check). */
if (UNLIKELY(uintptr_t(dw - dvert->dw) < uintptr_t(dvert->totweight))) {
/* Assert as an invalid `dw` (while supported) isn't likely to do what the caller expected. */
BLI_assert_unreachable();
return;
}