[Bf-blender-cvs] [9af6c041e8f] blender-v2.91-release: Fix T82265: GPencil interpolate crash when next frame was NULL

Antonio Vazquez noreply at git.blender.org
Sat Oct 31 09:24:53 CET 2020


Commit: 9af6c041e8fc2f32d9db53b7821111ca724ead17
Author: Antonio Vazquez
Date:   Sat Oct 31 09:24:43 2020 +0100
Branches: blender-v2.91-release
https://developer.blender.org/rB9af6c041e8fc2f32d9db53b7821111ca724ead17

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.

===================================================================

M	source/blender/editors/gpencil/gpencil_interpolate.c

===================================================================

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");



More information about the Bf-blender-cvs mailing list