[Bf-blender-cvs] [1935cd4027a] master: Fix T74837: GPencil: Mirror over first selected marker crashes
Philipp Oeser
noreply at git.blender.org
Wed Mar 18 20:52:21 CET 2020
Commit: 1935cd4027ac369f19caae12bb027ff794473d8b
Author: Philipp Oeser
Date: Tue Mar 17 18:58:06 2020 +0100
Branches: master
https://developer.blender.org/rB1935cd4027ac369f19caae12bb027ff794473d8b
Fix T74837: GPencil: Mirror over first selected marker crashes
'mirror_gpf_marker()' needs a NULL bGPDframe for initialization [but
still requires a scene to get the marker].
Maniphest Tasks: T74837
Differential Revision: https://developer.blender.org/D7166
===================================================================
M source/blender/editors/gpencil/editaction_gpencil.c
===================================================================
diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c
index 86355787b3c..7f659efb099 100644
--- a/source/blender/editors/gpencil/editaction_gpencil.c
+++ b/source/blender/editors/gpencil/editaction_gpencil.c
@@ -612,13 +612,13 @@ static short mirror_gpf_marker(bGPDframe *gpf, Scene *scene)
/* In order for this mirror function to work without
* any extra arguments being added, we use the case
- * of bezt==NULL to denote that we should find the
+ * of gpf==NULL to denote that we should find the
* marker to mirror over. The static pointer is safe
* to use this way, as it will be set to null after
* each cycle in which this is called.
*/
- if (gpf) {
+ if (gpf != NULL) {
/* mirroring time */
if ((gpf->flag & GP_FRAME_SELECT) && (marker)) {
diff = (marker->frame - gpf->framenum);
@@ -659,9 +659,9 @@ void ED_gplayer_mirror_frames(bGPDlayer *gpl, Scene *scene, short mode)
ED_gplayer_frames_looper(gpl, scene, mirror_gpf_xaxis);
break;
case MIRROR_KEYS_MARKER: /* mirror over marker */
- mirror_gpf_marker(NULL, NULL);
+ mirror_gpf_marker(NULL, scene);
ED_gplayer_frames_looper(gpl, scene, mirror_gpf_marker);
- mirror_gpf_marker(NULL, NULL);
+ mirror_gpf_marker(NULL, scene);
break;
default: /* just in case */
ED_gplayer_frames_looper(gpl, scene, mirror_gpf_yaxis);
More information about the Bf-blender-cvs
mailing list