fix for crash drawing grease pencil attached to a tracking marker.
[blender.git] / source / blender / editors / space_clip / clip_draw.c
index a9b23d5b939c97eefd6191b2d8a394a6ce06b36f..655a09ec90c4c2ffbb85c7973108b6496bf8ad97 100644 (file)
@@ -1467,9 +1467,11 @@ void clip_draw_grease_pencil(bContext *C, int onlyv2d)
 
                                if (track) {
                                        int framenr = sc->user.framenr;
-                                       MovieTrackingMarker *marker = BKE_tracking_exact_marker(track, framenr);
-
-                                       glTranslatef(marker->pos[0], marker->pos[1], 0.0f);
+                                       /* don't get the exact marker since it may not exist for the frame */
+                                       MovieTrackingMarker *marker = BKE_tracking_get_marker(track, framenr);
+                                       if (marker) {
+                                               glTranslatef(marker->pos[0], marker->pos[1], 0.0f);
+                                       }
                                }
                        }