diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-21 19:45:31 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-21 19:45:31 +0400 |
commit | 70ce11d640e0a85c863db08f269167a75c0eb251 (patch) | |
tree | 3c96169ec794d7ef0c9ada243cc88bd937e322e7 /source/blender | |
parent | c691551249f3fe3982c43e4c75be40a19503dd26 (diff) |
Minor cleanup from latest coverity checks - if we have a previous curve, we can safely assume we also have a previous stroke!
Better to assert here, than checking this randomly...
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 09cfcf5256f..5d992824e3b 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -921,6 +921,8 @@ static void gp_stroke_to_path(bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Curv float p1[3], p2[3], p[3], next_p[3]; float dt1 = 0.0f, dt2 = 0.0f; + BLI_assert(gps->prev != NULL); + prev_bp = NULL; if ((old_nbp > 1) && (gps->prev->totpoints > 1)) { /* Only use last curve segment if previous stroke was not a single-point one! */ @@ -1128,6 +1130,8 @@ static void gp_stroke_to_bezier(bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Cu /* If needed, make the link between both strokes with two zero-radius additional points */ if (curnu && old_nbezt) { + BLI_assert(gps->prev != NULL); + /* Update last point's second handle */ if (stitch) { bezt = &nu->bezt[old_nbezt - 1]; @@ -1150,7 +1154,7 @@ static void gp_stroke_to_bezier(bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Cu float dt1 = 0.0f, dt2 = 0.0f; prev_bezt = NULL; - if (old_nbezt > 1 && gps->prev && gps->prev->totpoints > 1) { + if ((old_nbezt > 1) && (gps->prev->totpoints > 1)) { /* Only use last curve segment if previous stroke was not a single-point one! */ prev_bezt = &nu->bezt[old_nbezt - 2]; } |