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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-19 19:51:25 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-19 19:51:25 +0300
commita8fa291b8c539da7669463ef622d5c61ee9c90e7 (patch)
treefc20d7096791dba8e7213d7dbd1939a3502716e1 /source/blender/editors/interface/interface_eyedropper.c
parent50cbff185130e914f423a6008e71af035f44dd8f (diff)
Fix two potential bugs reported by latest coverity scan.
Diffstat (limited to 'source/blender/editors/interface/interface_eyedropper.c')
-rw-r--r--source/blender/editors/interface/interface_eyedropper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_eyedropper.c b/source/blender/editors/interface/interface_eyedropper.c
index d7a4720d595..9b5d067e9be 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);
}