[Bf-blender-cvs] [6f0b0823781] master: Animation: fix assertion failure on unsetting active keyframe

Sybren A. Stüvel noreply at git.blender.org
Mon Oct 12 17:27:30 CEST 2020


Commit: 6f0b082378133afd944cc6af2e992c5f9fb12cd3
Author: Sybren A. Stüvel
Date:   Mon Oct 12 17:27:27 2020 +0200
Branches: master
https://developer.blender.org/rB6f0b082378133afd944cc6af2e992c5f9fb12cd3

Animation: fix assertion failure on unsetting active keyframe

Avoid NULL pointer dereference when checking keyframe selection state in
`BLI_assert()` call.

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

M	source/blender/blenkernel/intern/fcurve.c

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

diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index d57ef45107c..2f8a8fcffdc 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -840,7 +840,7 @@ bool BKE_fcurve_calc_range(
 void BKE_fcurve_active_keyframe_set(FCurve *fcu, const BezTriple *active_bezt)
 {
   /* The active keyframe should always be selected. */
-  BLI_assert(active_bezt->f2 & SELECT);
+  BLI_assert(active_bezt == NULL || (active_bezt->f2 & SELECT));
   fcu->active_keyframe_index = (active_bezt == NULL) ? FCURVE_ACTIVE_KEYFRAME_NONE :
                                                        active_bezt - fcu->bezt;
 }



More information about the Bf-blender-cvs mailing list