From 1935cd4027ac369f19caae12bb027ff794473d8b Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 17 Mar 2020 18:58:06 +0100 Subject: 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 --- source/blender/editors/gpencil/editaction_gpencil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '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); -- cgit v1.2.3