From 6c99d342d8ab68a60ceddb3ecdca48516fc8ba4d Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Mon, 28 Dec 2015 16:48:35 +0100 Subject: Minor cleanup (paranoid checks) and fixes from coverity. --- source/blender/editors/space_view3d/drawarmature.c | 10 ++++++---- source/blender/editors/space_view3d/drawobject.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 2ff3dcdda29..e35c70048e7 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -119,11 +119,12 @@ static void set_pchan_colorset(Object *ob, bPoseChannel *pchan) bcolor = &btheme->tarm[(color_index - 1)]; } else if (color_index == -1) { - /* use the group's own custom color set */ - bcolor = (grp) ? &grp->cs : NULL; + /* use the group's own custom color set (grp is always != NULL here) */ + bcolor = &grp->cs; } - else + else { bcolor = NULL; + } } /* This function is for brightening/darkening a given color (like UI_ThemeColorShade()) */ @@ -1435,7 +1436,8 @@ static void pchan_draw_IK_root_lines(bPoseChannel *pchan, short only_temp) if (segcount == data->chainlen || segcount > 255) break; /* 255 is weak */ parchan = parchan->parent; } - if (parchan) /* XXX revise the breaking conditions to only stop at the tail? */ + /* Only draw line in case our chain is more than one bone long! */ + if (parchan != pchan) /* XXX revise the breaking conditions to only stop at the tail? */ glVertex3fv(parchan->pose_head); glEnd(); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index b59a6d88bfa..41b22f49613 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -4297,7 +4297,7 @@ static bool draw_mesh_object(Scene *scene, ARegion *ar, View3D *v3d, RegionView3 GPU_end_object_materials(); - if (obedit != ob && finalDM) + if (obedit != ob) finalDM->release(finalDM); } else { -- cgit v1.2.3