Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-10-26 11:13:44 +0300
committerBastien Montagne <bastien@blender.org>2021-10-26 11:13:44 +0300
commit9ba22bd1f77a4b168ce19e941fe84837fc69f701 (patch)
treec30ab672c5944f716f1bd992d63b952a56042fdd /source/blender
parent7bc7d1747c96e4f4159a91b8ceffd112168c6907 (diff)
Fix crash in liboverride/pointcache handling code after recent changes.
In some cases code would try to access NULL pointer. Reported by @dfelinto, thanks.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/object.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 45dfb9af074..7103f0a4db6 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1159,10 +1159,14 @@ static void object_lib_override_apply_post(ID *id_dst, ID *id_src)
for (pid_dst = pidlist_dst.first, pid_src = pidlist_src.first; pid_dst != NULL;
pid_dst = pid_dst->next, pid_src = (pid_src != NULL) ? pid_src->next : NULL) {
/* If pid's do not match, just tag info of caches in dst as dirty and continue. */
- if (pid_src == NULL || pid_dst->type != pid_src->type ||
- pid_dst->file_type != pid_src->file_type ||
- pid_dst->default_step != pid_src->default_step || pid_dst->max_step != pid_src->max_step ||
- pid_dst->data_types != pid_src->data_types || pid_dst->info_types != pid_src->info_types) {
+ if (pid_src == NULL) {
+ continue;
+ }
+ else if (pid_dst->type != pid_src->type || pid_dst->file_type != pid_src->file_type ||
+ pid_dst->default_step != pid_src->default_step ||
+ pid_dst->max_step != pid_src->max_step ||
+ pid_dst->data_types != pid_src->data_types ||
+ pid_dst->info_types != pid_src->info_types) {
LISTBASE_FOREACH (PointCache *, point_cache_src, pid_src->ptcaches) {
point_cache_src->flag |= PTCACHE_FLAG_INFO_DIRTY;
}