Skip to content

Commit

Permalink
Tracking: Avoid integer overflow in dopesheet update
Browse files Browse the repository at this point in the history
Straightforward check to discard cases when dopesheet is being updated
for a movie clip which has no markers at all.

Possible bugfix for T86847.
  • Loading branch information
sergeyvfx committed Mar 29, 2021
1 parent e0ce76f commit 8f38534
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/blender/blenkernel/intern/tracking.c
Original file line number Diff line number Diff line change
Expand Up @@ -3251,6 +3251,11 @@ static void tracking_dopesheet_calc_coverage(MovieTracking *tracking)
end_frame = max_ii(end_frame, track->markers[track->markersnr - 1].framenr);
}

if (start_frame > end_frame) {
/* There are no markers at all, nothing to calculate coverage from. */
return;
}

frames = end_frame - start_frame + 1;

/* this is a per-frame counter of markers (how many markers belongs to the same frame) */
Expand Down

0 comments on commit 8f38534

Please sign in to comment.