Cleanup: remove paranoid 'MDeformVert.totweight < 0' check
This was added in 1cb7267a9f, however the behavior before this
would have failed on negative values already.
Also negative values here would fail in many other places.
This commit is contained in:
@@ -1554,10 +1554,10 @@ void BKE_defvert_blend_read(BlendDataReader *reader, int count, MDeformVert *mdv
|
||||
}
|
||||
|
||||
for (int i = count; i > 0; i--, mdverts++) {
|
||||
/*convert to vgroup allocation system*/
|
||||
/* Convert to vertex group allocation system. */
|
||||
MDeformWeight *dw;
|
||||
if (mdverts->dw && (dw = BLO_read_get_new_data_address(reader, mdverts->dw))) {
|
||||
const size_t dw_len = MAX2(mdverts->totweight, 0) * sizeof(MDeformWeight);
|
||||
const size_t dw_len = sizeof(MDeformWeight) * mdverts->totweight;
|
||||
void *dw_tmp = MEM_mallocN(dw_len, __func__);
|
||||
memcpy(dw_tmp, dw, dw_len);
|
||||
mdverts->dw = dw_tmp;
|
||||
|
||||
Reference in New Issue
Block a user