Page MenuHome

Motion Tracking: Track path tries to draw point counts <=0 (asserts)
Closed, ResolvedPublic

Description

Blender Version
Broken: (28ee0f97c3)

Short description of error
With a tracking marker added with no tracking done, draw_track_path()tries to draw 0 or -1 vertices, both are invalid values for immBegin() (assert fails).

Exact steps for others to reproduce the error

  • Factory Settings
  • Add Motion Tracking workspace
  • Load some footage
  • Ctrl + L to add a marker
  • Press spacebar for playback

Can probably early exit in draw_track_path_points(), draw_track_path_lines() already does:

diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index f1b7630003e..08eec0adf53 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -462,6 +462,10 @@ static void draw_track_path_points(const TrackPathPoint *path,
                                    const int start_point,
                                    const int num_points)
 {
+  if (num_points <= 0) {
+    return;
+  }
+
   immBegin(GPU_PRIM_POINTS, num_points);
   for (int i = 0; i < num_points; i++) {
     const TrackPathPoint *point = &path[i + start_point];