diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2019-07-31 22:13:29 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2019-07-31 22:24:34 +0300 |
commit | ea3690e32974005c6ccb871f4e2f49471ad837ab (patch) | |
tree | d7145b6ed375599ee5534c5a1cd102012baf8150 /source/blender/depsgraph/intern | |
parent | 77d7cc9ba7a9c23c269cb89e8f6da9c800558973 (diff) |
Fix several undefined-behaviour-sanitizer warnings
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D4222
Diffstat (limited to 'source/blender/depsgraph/intern')
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 59f0c8c1933..392514990e3 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -325,25 +325,31 @@ void deg_graph_id_tag_legacy_compat( * tagging here. */ case ID_ME: { Mesh *mesh = (Mesh *)id; - ID *key_id = &mesh->key->id; - if (key_id != NULL) { - graph_id_tag_update(bmain, depsgraph, key_id, 0, update_source); + if (mesh->key != NULL) { + ID *key_id = &mesh->key->id; + if (key_id != NULL) { + graph_id_tag_update(bmain, depsgraph, key_id, 0, update_source); + } } break; } case ID_LT: { Lattice *lattice = (Lattice *)id; - ID *key_id = &lattice->key->id; - if (key_id != NULL) { - graph_id_tag_update(bmain, depsgraph, key_id, 0, update_source); + if (lattice->key != NULL) { + ID *key_id = &lattice->key->id; + if (key_id != NULL) { + graph_id_tag_update(bmain, depsgraph, key_id, 0, update_source); + } } break; } case ID_CU: { Curve *curve = (Curve *)id; - ID *key_id = &curve->key->id; - if (key_id != NULL) { - graph_id_tag_update(bmain, depsgraph, key_id, 0, update_source); + if (curve->key != NULL) { + ID *key_id = &curve->key->id; + if (key_id != NULL) { + graph_id_tag_update(bmain, depsgraph, key_id, 0, update_source); + } } break; } |