mirror of
https://projects.blender.org/blender/blender.git
synced 2025-01-22 07:22:12 -05:00
Fix #133241: don't crash on Frame All in motion tracker dopesheet
When there was an empty (no keyframes) track in the motion tracker's dopesheet, Blender would crash when running the Frame All operator. The issue was that the code computing the frame range was trying to access non-existant data on the empty track, leading to a null pointer dereference. This fixes the issue by guarding that code with a nullptr check. Pull Request: https://projects.blender.org/blender/blender/pulls/133371
This commit is contained in:
parent
b2a06888c7
commit
97d981a167
1 changed files with 4 additions and 2 deletions
|
@ -159,8 +159,10 @@ static int dopesheet_view_all_exec(bContext *C, wmOperator * /*op*/)
|
||||||
int frame_min = INT_MAX, frame_max = INT_MIN;
|
int frame_min = INT_MAX, frame_max = INT_MIN;
|
||||||
|
|
||||||
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
LISTBASE_FOREACH (MovieTrackingDopesheetChannel *, channel, &dopesheet->channels) {
|
||||||
frame_min = min_ii(frame_min, channel->segments[0]);
|
if (channel->segments) {
|
||||||
frame_max = max_ii(frame_max, channel->segments[channel->tot_segment]);
|
frame_min = min_ii(frame_min, channel->segments[0]);
|
||||||
|
frame_max = max_ii(frame_max, channel->segments[channel->tot_segment]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame_min < frame_max) {
|
if (frame_min < frame_max) {
|
||||||
|
|
Loading…
Reference in a new issue