Fix crash with fff mmu

This commit is contained in:
tamasmeszaros 2023-01-16 19:47:35 +01:00
parent 7d6c2cad0a
commit 0fa9bcc63b

View File

@ -7100,9 +7100,12 @@ const ModelVolume *get_model_volume(const GLVolume &v, const Model &model)
const ModelVolume * ret = nullptr;
if (model.objects.size() < v.object_idx()) {
const ModelObject *obj = model.objects[v.object_idx()];
if (obj->volumes.size() < v.volume_idx())
ret = obj->volumes[v.volume_idx()];
if (v.object_idx() < model.objects.size()) {
const ModelObject *obj = model.objects[v.object_idx()];
if (v.volume_idx() < obj->volumes.size()) {
ret = obj->volumes[v.volume_idx()];
}
}
}
return ret;