Fix T47217: Crash when tracking specific scene

This commit is contained in:
Sergey Sharybin 2016-01-24 23:38:24 +05:00
parent da1dce7f79
commit 9797a135e3
Notes: blender-bot 2023-04-04 07:45:26 +02:00
Referenced by issue #47217, Crash when adding tracking new tracker
1 changed files with 12 additions and 1 deletions

View File

@ -482,7 +482,18 @@ MovieTrackingMarker *tracking_get_keyframed_marker(MovieTrackingTrack *track,
* fallback to the first marker in current tracked segment
* as a keyframe.
*/
if (next_marker && next_marker->flag & MARKER_DISABLED) {
if (next_marker == NULL) {
/* Could happen when trying to get reference marker for the fist
* one on the segment which isn't surrounded by disabled markers.
*
* There's no really good choise here, just use the reference
* marker which looks correct..
*/
if (marker_keyed_fallback == NULL) {
marker_keyed_fallback = cur_marker;
}
}
else if (next_marker->flag & MARKER_DISABLED) {
if (marker_keyed_fallback == NULL)
marker_keyed_fallback = cur_marker;
}