[Bf-blender-cvs] [9ba22bd1f77] master: Fix crash in liboverride/pointcache handling code after recent changes.
Bastien Montagne
noreply at git.blender.org
Tue Oct 26 10:14:47 CEST 2021
Commit: 9ba22bd1f77a4b168ce19e941fe84837fc69f701
Author: Bastien Montagne
Date: Tue Oct 26 10:13:44 2021 +0200
Branches: master
https://developer.blender.org/rB9ba22bd1f77a4b168ce19e941fe84837fc69f701
Fix crash in liboverride/pointcache handling code after recent changes.
In some cases code would try to access NULL pointer.
Reported by @dfelinto, thanks.
===================================================================
M source/blender/blenkernel/intern/object.c
===================================================================
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;
}
More information about the Bf-blender-cvs
mailing list