diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-25 18:55:08 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-01-25 18:55:08 +0300 |
commit | 60663c8ec42f1cf0f527a42ea3c6ebbd9b4d3153 (patch) | |
tree | d6e7109c5d96b09ea848df2151ab13b65414a3d1 /source/blender/editors | |
parent | 9e56d75470acad4de30cc945f5ea988d0cf647c6 (diff) |
Fix various potential bugs from coverity reports (NULL dereference, negative number assigned to uint...).
Note: the wm_jobs needs proper fix, we cannot have that kind of inconsistencies in some 'public' API!
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 2ba07971424..e4e9976c10d 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -168,7 +168,7 @@ static void load_tex_task_cb_ex(void *userdata, void *UNUSED(userdata_chunck), c bool convert_to_linear = false; struct ColorSpace *colorspace = NULL; - if (mtex->tex->type == TEX_IMAGE && mtex->tex->ima) { + if (mtex->tex && mtex->tex->type == TEX_IMAGE && mtex->tex->ima) { ImBuf *tex_ibuf = BKE_image_pool_acquire_ibuf(mtex->tex->ima, &mtex->tex->iuser, pool); /* For consistency, sampling always returns color in linear space */ if (tex_ibuf && tex_ibuf->rect_float == NULL) { diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index f90df4ba45e..f245685abbd 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2081,9 +2081,6 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P bool use_face_sel; bool use_depth; - float (*blur_weight_func)(MDeformVert *, WeightPaintInfo *) = - wpd->do_multipaint ? wpaint_blur_weight_multi : wpaint_blur_weight_single; - const float pressure = RNA_float_get(itemptr, "pressure"); const float brush_size_pressure = BKE_brush_size_get(scene, brush) * (BKE_brush_use_size_pressure(scene, brush) ? pressure : 1.0f); @@ -2102,6 +2099,9 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P return; } + float (*blur_weight_func)(MDeformVert *, WeightPaintInfo *) = + wpd->do_multipaint ? wpaint_blur_weight_multi : wpaint_blur_weight_single; + vc = &wpd->vc; ob = vc->obact; me = ob->data; |