GPencil: Fix unreported interpolate crash if no frames
If there is a layer that hasn't frames but is not the active layer the pointer to frames can be NULL and crash. Now, the empty layers are skipped. Reported to me by Samuel Bernou.
This commit is contained in:
@@ -491,9 +491,15 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
|
||||
|
||||
tgpil->gpl = gpl;
|
||||
bGPDframe *gpf = gpencil_get_previous_keyframe(gpl, scene->r.cfra, exclude_breakdowns);
|
||||
if (gpf == NULL) {
|
||||
continue;
|
||||
}
|
||||
tgpil->prevFrame = BKE_gpencil_frame_duplicate(gpf, true);
|
||||
|
||||
gpf = gpencil_get_next_keyframe(gpl, scene->r.cfra, exclude_breakdowns);
|
||||
if (gpf == NULL) {
|
||||
continue;
|
||||
}
|
||||
tgpil->nextFrame = BKE_gpencil_frame_duplicate(gpf, true);
|
||||
|
||||
BLI_addtail(&tgpi->ilayers, tgpil);
|
||||
|
||||
Reference in New Issue
Block a user