[Bf-blender-cvs] [a8fa291] master: Fix two potential bugs reported by latest coverity scan.
Bastien Montagne
noreply at git.blender.org
Mon Jan 19 17:52:20 CET 2015
Commit: a8fa291b8c539da7669463ef622d5c61ee9c90e7
Author: Bastien Montagne
Date: Mon Jan 19 17:51:25 2015 +0100
Branches: master
https://developer.blender.org/rBa8fa291b8c539da7669463ef622d5c61ee9c90e7
Fix two potential bugs reported by latest coverity scan.
===================================================================
M source/blender/editors/interface/interface_eyedropper.c
M source/blender/editors/mesh/editmesh_knife.c
===================================================================
diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c
index d7a4720..9b5d067 100644
--- a/source/blender/editors/interface/interface_eyedropper.c
+++ b/source/blender/editors/interface/interface_eyedropper.c
@@ -830,8 +830,10 @@ static void depthdropper_depth_set(bContext *C, DepthDropper *ddr, const float d
/* set sample from accumulated values */
static void depthdropper_depth_set_accum(bContext *C, DepthDropper *ddr)
{
- float depth;
- depth = ddr->accum_depth * 1.0f / (float)ddr->accum_tot;
+ float depth = ddr->accum_depth;
+ if (ddr->accum_tot) {
+ depth /= (float)ddr->accum_tot;
+ }
depthdropper_depth_set(C, ddr, depth);
}
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index 0a78f29..e8a5202 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -1241,7 +1241,9 @@ static BMElem *bm_elem_from_knife_vert(KnifeVert *kfv, KnifeEdge **r_kfe)
for (ref = kfv->edges.first; ref; ref = ref->next) {
kfe = ref->ref;
if (kfe->e) {
- *r_kfe = kfe;
+ if (r_kfe) {
+ *r_kfe = kfe;
+ }
break;
}
}
More information about the Bf-blender-cvs
mailing list