Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-10-31 11:24:43 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-10-31 11:24:43 +0300
commit9af6c041e8fc2f32d9db53b7821111ca724ead17 (patch)
tree45d9672ace7d47f45dd0787f4a63ce6d7eacd628 /source/blender/editors/gpencil/gpencil_interpolate.c
parent8b806c86e12e92ffc8b486a69ce4de5938f09b4a (diff)
Fix T82265: GPencil interpolate crash when next frame was NULL
If the next frame of the layer was NULL and it was not the active layer crashed.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_interpolate.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 380dfd1a7a2..2e13566402b 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -235,7 +235,9 @@ static bool gpencil_interpolate_check_todo(bContext *C, bGPdata *gpd)
/* get final stroke to interpolate */
fFrame = BLI_findindex(&gpl->actframe->strokes, gps_from);
- gps_to = BLI_findlink(&gpl->actframe->next->strokes, fFrame);
+ gps_to = (gpl->actframe->next != NULL) ?
+ BLI_findlink(&gpl->actframe->next->strokes, fFrame) :
+ NULL;
if (gps_to == NULL) {
continue;
}
@@ -273,6 +275,9 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi)
if (!BKE_gpencil_layer_is_editable(gpl) || (gpl->actframe == NULL)) {
continue;
}
+ if ((gpl->actframe == NULL) || (gpl->actframe->next == NULL)) {
+ continue;
+ }
/* create temp data for each layer */
tgpil = MEM_callocN(sizeof(tGPDinterpolate_layer), "GPencil Interpolate Layer");