[Bf-blender-cvs] [6589d07] master: Action Editor: Preemptive fix for null-pointer dereference

Joshua Leung noreply at git.blender.org
Thu Apr 16 15:17:45 CEST 2015


Commit: 6589d07c8faa6f2705530ed0dfc6ec30a77c72f2
Author: Joshua Leung
Date:   Fri Apr 17 01:10:27 2015 +1200
Branches: master
https://developer.blender.org/rB6589d07c8faa6f2705530ed0dfc6ec30a77c72f2

Action Editor: Preemptive fix for null-pointer dereference

A few weeks ago, I got a random crash while testing som edge cases
(IIRC, it was trying to assign an action with no active object),
which I haven't been able to reproduce since then. This commit though
adds some extra sanity checks here, as a user may try to assign an
action to an animdata block which did not have an action already.

===================================================================

M	source/blender/makesrna/intern/rna_space.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index ca3ea9b..8e3c4e5 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -1225,7 +1225,9 @@ static void rna_SpaceDopeSheetEditor_action_update(Main *UNUSED(bmain), Scene *s
 		/* set action */
 		if (adt) {
 			/* fix id-count of action we're replacing */
-			id_us_min(&adt->action->id);
+			if (adt->action) {
+				id_us_min(&adt->action->id);
+			}
 			
 			/* assign new action, and adjust the usercounts accordingly */
 			adt->action = saction->action;




More information about the Bf-blender-cvs mailing list