Fix T45017: Crash when running 'track markers' operator with no clip loaded.

CLIP_OT_track_markers was missing a poll callback.
This commit is contained in:
Bastien Montagne 2015-06-10 17:22:49 +02:00
parent 3560e36ee9
commit 825892ae7a
Notes: blender-bot 2023-02-14 09:01:31 +01:00
Referenced by issue #45017, crash in movie clip editor
2 changed files with 6 additions and 1 deletions

View File

@ -219,7 +219,10 @@ int ED_space_clip_get_clip_frame_number(SpaceClip *sc)
{
MovieClip *clip = ED_space_clip_get_clip(sc);
return BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr);
if (clip) {
return BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr);
}
return 0;
}
ImBuf *ED_space_clip_get_buffer(SpaceClip *sc)

View File

@ -1426,6 +1426,7 @@ static int track_markers_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS
}
clip = ED_space_clip_get_clip(sc);
BLI_assert(clip);
framenr = ED_space_clip_get_clip_frame_number(sc);
if (WM_jobs_test(CTX_wm_manager(C), sa, WM_JOB_TYPE_ANY)) {
@ -1504,6 +1505,7 @@ void CLIP_OT_track_markers(wmOperatorType *ot)
ot->exec = track_markers_exec;
ot->invoke = track_markers_invoke;
ot->modal = track_markers_modal;
ot->poll = ED_space_clip_tracking_poll;
/* flags */
ot->flag = OPTYPE_UNDO;