This should solve the crash that happened when the MDeformWeight->def_nr was greater than the number of bDeformGroup structs associated with the object. I was unable to determine the scenario that created these conditions but this logic should be identical to how their internal code handles it (see BKE_defvert_find_index).
This should solve the crash that happened when the MDeformWeight->def_nr was greater than the number of bDeformGroup structs associated with the object. I was unable to determine the scenario that created these conditions but this logic should be identical to how their internal code handles it (see BKE_defvert_find_index).