[Bf-blender-cvs] [d68e29b62ce] master: Workbench: Fix missing NULL pointer check

Clément Foucault noreply at git.blender.org
Tue Jun 9 10:59:33 CEST 2020


Commit: d68e29b62ce299085f4f27e3d6a66dbfc1c89610
Author: Clément Foucault
Date:   Tue Jun 9 10:59:19 2020 +0200
Branches: master
https://developer.blender.org/rBd68e29b62ce299085f4f27e3d6a66dbfc1c89610

Workbench: Fix missing NULL pointer check

===================================================================

M	source/blender/draw/engines/workbench/workbench_engine.c

===================================================================

diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c
index bc5a2c14538..828a9127fb1 100644
--- a/source/blender/draw/engines/workbench/workbench_engine.c
+++ b/source/blender/draw/engines/workbench/workbench_engine.c
@@ -211,7 +211,7 @@ static void workbench_cache_hair_populate(WORKBENCH_PrivateData *wpd,
   const ImagePaintSettings *imapaint = use_texpaint_mode ? &scene->toolsettings->imapaint : NULL;
   Image *ima = (imapaint && imapaint->mode == IMAGEPAINT_MODE_IMAGE) ? imapaint->canvas : NULL;
   eGPUSamplerState state = 0;
-  SET_FLAG_FROM_TEST(state, imapaint->interp == IMAGEPAINT_INTERP_LINEAR, GPU_SAMPLER_FILTER);
+  state |= (imapaint && imapaint->interp == IMAGEPAINT_INTERP_LINEAR) ? GPU_SAMPLER_FILTER : 0;
   DRWShadingGroup *grp = (use_texpaint_mode) ?
                              workbench_image_hair_setup(wpd, ob, matnr, ima, NULL, state) :
                              workbench_material_hair_setup(wpd, ob, matnr, color_type);



More information about the Bf-blender-cvs mailing list